I have an XY plot of positions and want the newest point to be an icon. Is this possible in JFreeChart?
Asked
Active
Viewed 2,001 times
1 Answers
6
On an xy plot you would need to keep track of the last xy point added and then add it using something like the following:
double x = 150;
double y = 300;
XYPlot plot = chart.getXYPlot();
ImageIcon imageIcon = new ImageIcon("/path/to/your/icon.png");
XYAnnotation xyannotation = new XYImageAnnotation(x, y, imageIcon.getImage());
plot.addAnnotation(xyannotation);

Eric Ness
- 391
- 1
- 4
-
Is there a way to turn off the annotation offset? – ShawnD Feb 09 '09 at 17:49
-
Sorry anwered my own question. – ShawnD Feb 09 '09 at 18:10