customized Legend

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

customized Legend

Post by Juan » Wed Oct 23, 2002 2:49 am

Is there a way that the legend can be disassociated to the series.
I am using a single bar series to create a Horizontal Bar Chart and setting the colors using the setCategoriesPaint(java.awt.Paint[] paint) method.

I need to create a legend with 5 items and set the color for those items. (Again not having a single series).

How can I do this?

I looked into the LegendTitle but not sure this is it.

Thanks in advance!

Juan.

Dave Gilbert

Re: customized Legend

Post by Dave Gilbert » Wed Oct 23, 2002 9:04 am

You could write your own legend class, extend Legend and implement your own draw method. There's nothing really special about the legend, it is just a box with some text and shapes in it...StandardLegend just happens to draw one item per series, corresponding to the data in the chart.

Regards,

DG.

juan

Re: customized Legend

Post by juan » Thu Oct 24, 2002 3:45 am

Ok... thanks!

Locked