annotations

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
bharat

annotations

Post by bharat » Wed Jan 08, 2003 4:31 am

how can i put annotation on the plot
i am not able to put using XYAnnotations class.
for example i need to put max Y value on some location of x,y coordinates on the plot
reg
Bharat

David Gilbert

Re: annotations

Post by David Gilbert » Thu Jan 09, 2003 7:33 am

Hi Bharat,

First create an instance of XYTextAnnotation - you supply the text (and font maybe) and the (x, y) coordinates where you want the text displayed.

Then you pass your annotation to the addAnnotation(...) method in the XYPlot class. Now, whenever the chart is drawn, your text will be displayed at the specified coordinates.

There are lots of improvements that can be made to this framework, but it provides a basic function for now.

Regards,

Dave Gilbert

Locked