CategoryTextAnnotation

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jaypee
Posts: 32
Joined: Fri Mar 24, 2006 2:35 am

CategoryTextAnnotation

Post by jaypee » Wed May 03, 2006 3:02 am

Hi,

I'm trying to add categorytextannotation but so far I'm having trouble doing that.

Any help? Thanks =) I'm using a CategoryPlot

Jaypee

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed May 03, 2006 6:05 am

Try something like this:

Code: Select all

plot.addAnnotation(new CategoryTextAnnotation("Some text...", "Category 2", 7.5));
This places the text "Some text..." on the plot at the location ("Category 2", 7.5) - adjust these values to suit your own dataset ranges.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jaypee
Posts: 32
Joined: Fri Mar 24, 2006 2:35 am

Post by jaypee » Fri May 05, 2006 9:30 am

Hi David,

Thanks :-)

I was able to add the annotation however it didnt show up where i wanted to.
How can i get the x value and y value of the points in the dataset??

i used this but 0.184 was hard coded.... how can i get/select the x and y value to get the point in the dataset?:

Code: Select all

plot.addAnnotation(new CategoryTextAnnotation("This is a test annotation","Line",0.184));
thanks :-)


jaypee

Locked