What I am trying to do:
What I have tried:
public void customize(JFreeChart chart, JRChart jasperChart) {
BufferedImage image = chart.createBufferedImage(20, 20);
Graphics2D g2 = image.createGraphics();
g2.setColor(Color.RED);
g2.fill(new Rectangle2D.Double(1, 1, 5, 5));
chart.draw(g2, new Rectangle(10, 10, 20, 20));
chart.fireChartChanged();
chart.setTitle("abcd");
}
But i failed =(
Overlaying rectangle over a scatter chart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Overlaying rectangle over a scatter chart
If the rectangle is in a fixed location, you could add an XYBoxAnnotation to the chart.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Overlaying rectangle over a scatter chart
Awesome, it worked. Thank you very much . Just saved me from getting fired =D