Horiziontal Bar, largest Bar label lost

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Harakiri23
Posts: 4
Joined: Wed Jan 10, 2007 10:11 pm

Horiziontal Bar, largest Bar label lost

Post by Harakiri23 » Mon Oct 11, 2010 4:57 pm

Hi,

im using

StandardCategoryItemLabelGenerator labelGen = new StandardCategoryItemLabelGenerator(" {2} ({3})", new DecimalFormat("0"));
renderer.setBaseItemLabelGenerator(labelGen);
renderer.setBaseItemLabelsVisible(true);

to display the total + percentage, on the largest bar however, part of it is removed - anyone know the reason?

Its not an issue with padding, i removed that and no difference.

Image

Harakiri23
Posts: 4
Joined: Wed Jan 10, 2007 10:11 pm

Re: Horiziontal Bar, largest Bar label lost

Post by Harakiri23 » Tue Oct 12, 2010 1:48 pm

anyone?

svenn
Posts: 5
Joined: Tue Sep 28, 2010 11:51 pm
antibot: No, of course not.

Re: Horiziontal Bar, largest Bar label lost

Post by svenn » Tue Oct 12, 2010 8:31 pm

CategoryAxis categoryAxis = categoryplot.getDomainAxis();

categoryAxis.setMaximumCategoryLabelWidthRatio(some float value);

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Horiziontal Bar, largest Bar label lost

Post by paradoxoff » Tue Oct 12, 2010 9:44 pm

The y-axis takes up the entire width of the data area. By default, the range of the axis is selected in a way that the largest value is just visible (plus a little extra gap). Thus the bar fills most of the axis range.
To change that, you can increase the data range of the axis to a user defined value (e. g. to 20), or you can increase the upper margin of the axis.

Locked