Drawing my own legend.

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

Drawing my own legend.

Post by Bray Jones » Wed Aug 28, 2002 4:41 pm

Is there anyway to get the colors from the legend?

I don't want the legend shown on the graph because depending on the number of items, it "squeezes" the graph.

I'd like to generate my own legend. How can I pull the colors and label descriptions from the legend?

Thanks.

Bray

David Gilbert

Re: Drawing my own legend.

Post by David Gilbert » Fri Aug 30, 2002 7:38 am

Hi Bray,

The legend colors are taken from the Plot.getSeriesPaint(int) method.

The text items are taken from the Plot.getLegendItemLabels method.

Regards,

DG

Locked