XYTitleAnnotation

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
J.
Posts: 17
Joined: Fri Jun 27, 2008 5:30 pm

XYTitleAnnotation

Post by J. » Tue Aug 19, 2008 6:08 pm

I need to add a legend inside my CategoryPlot chart. On searching the forum this experimental class was the only thing I could find for doing this sort of thing but is there any way to use it with a CategoryPlot?

J.
Posts: 17
Joined: Fri Jun 27, 2008 5:30 pm

Post by J. » Tue Aug 19, 2008 7:43 pm

This is the sort of thing I need:

http://i7.photobucket.com/albums/y260/- ... /chart.jpg

If there is no way to add in the legend in like that on a CategoryPlot (I can get it to appear outside of the chart, but need it inside really), is there any way to recreate that chart using an XYPlot?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Tue Aug 19, 2008 9:04 pm

Code: Select all

org.jfree.chart.annotations.CategoryTextAnnotation
or

Code: Select all

org.jfree.chart.labels.StandardCategorySeriesLabelGenerator

J.
Posts: 17
Joined: Fri Jun 27, 2008 5:30 pm

Post by J. » Tue Aug 19, 2008 9:21 pm

On first inspection it looks like CategoryTextAnnotation can only be used to add text into a plot? I guess I could use that to place the text directly on the line but more ideal would be to have a proper legend at the side, but inside the graph.

Any demo code for StandardCategorySeriesLabelGenerator?

Locked