legend probelm

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
j
Posts: 14
Joined: Tue Jul 22, 2003 12:56 pm

legend probelm

Post by j » Wed Jul 23, 2003 6:01 am

u said u can override getLegendItems(). but this would return the existing legend items. i want to create new legend items and add it to the legend.
is this possible??




thanks
j

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 Jul 23, 2003 11:34 pm

When you override the method, you can make it return whatever you like...
David Gilbert
JFreeChart Project Leader

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

fse
Posts: 25
Joined: Thu Mar 27, 2003 9:21 am
Location: cologne, germany
Contact:

am i wrong? but ...

Post by fse » Fri Jul 25, 2003 1:54 pm

... i think i have to go that long way to just set the legend i want for a simple chart:

- i extend XYPlot to StepPlot,
- override getLegendItems()
- create the chart i want
- and surround the instance of my StepPlot with a dummy instance of a chart as follows
chart.setLegend(new StandardLegend(new JFreeChart(new StepPlot())));

i just wanted to delete half of the legend entries in the chart object.

am i wrong or am i not :-)

cu
frank

Locked