Bar size

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

Bar size

Post by Raul Escobedo » Mon Jan 08, 2001 10:13 pm

Is there a way to set a maximum size for the bars in the bar charts. When I have only one category in the chart the bar takes up the whole area for the chart which looks bad, can you set a size so that this wont happen and the chart looks right.

David Gilbert

RE: Bar size

Post by David Gilbert » Wed Jan 10, 2001 8:13 pm

Hi Raul,

If you mean the spacing between bars, take a look in the BarPlot class, where there are attributes to control spacing (introGap, trailGap, categoryGap and barGap).

The height of the bars depends only on the range set for the numerical axis - by default the top end of the range is 5% (I think) greater than the maximum data value. The NumberAxis class has methods for setting the range to custom values.

Hope this helps...

DG.

Locked