JFreeChart : how to draw some shapes in a chart?

G

Grand Paradis

Hi
I want to draw a rectangle in a bar chart. I tried this code, thinking
that it could draw a blue rectangle in my chart, but it does nothing.
Do you know why?


Image image = chart.createBufferedImage(500, 500);
Graphics2D g = (Graphics2D) image.getGraphics();
g.setColor(Color.blue);
Rectangle rect = new Rectangle(300, 300);
chart.getCategoryPlot().draw(g, rect, null, null);


I've already posted this question in the jfree forum (www.jfree.org)
but they haven't resolved my problem.
Thanks in advance

--- Cedric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top