Formating legend in BarChart (new line for each series)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
dings
Posts: 7
Joined: Fri May 04, 2007 10:22 am

Formating legend in BarChart (new line for each series)

Post by dings » Fri May 18, 2007 3:01 pm

Im having a bit of trouble figuring out how to specify placement for
the labels of different series in the legend "list".

I want to do this because I have five series with quite long descriptions,
this leads to four of them getting a new line in the legend and two shearing.
This would look a lot better if I was able to specify that every item in the
legend should appear on a line of it's own.

Any idèas?

tatia34
Posts: 23
Joined: Fri Apr 27, 2007 2:11 pm
Location: France

Post by tatia34 » Mon May 21, 2007 7:42 am

You have to use a LegendTitle; create whith the plot of your chart and with ColumnArrangement

Code: Select all

LegendTitle legend = new LegendTitle(chart.getPlot(),new ColumnArrangement(), new ColumnArrangement(),
legend.setPosition(RectangleEdge.BOTTOM);
chart.addSubtitle(legend);

Locked