Item label in XY line chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rkanha
Posts: 2
Joined: Fri Jun 15, 2007 8:50 am

Item label in XY line chart

Post by rkanha » Fri Jun 15, 2007 8:55 am

hi,

i want to print some text above data point in XYLine Chart.
is it possible??

Thanks,
-AK

rkanha
Posts: 2
Joined: Fri Jun 15, 2007 8:50 am

Re: Item label in XY line chart

Post by rkanha » Mon Jun 18, 2007 1:53 pm

Hi,

So far 93 people have viewed this post ... no answers/reply yet :))

guess it is not possible.

TIA,
-AK.

azr
Posts: 13
Joined: Sun Apr 29, 2007 6:05 pm

Post by azr » Mon Jun 18, 2007 3:45 pm

You mean an annotation?
Maybe this will help you :

Look the addAnnotation method

I'm using it in my code:

Code: Select all

public void setNewTextAnnotation( String text, Point2D point)
{
XYTextAnnotation xyTextAnnotation = new XYTextAnnotation (text,point.getX(),point.getY());
((XYPlot)this.plot).addAnnotation(xyTextAnnotation);
}

Locked