Changing Bar Chart scale to whole numbers

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

Changing Bar Chart scale to whole numbers

Post by Awais Bajwa » Mon Oct 21, 2002 9:17 am

Hello ,
Is it possible to chage the bar-chart scale to whole numbers fixed as i have seen the dynamic behaviour of the vertical scale .Some times these values are automatically converted into decimal numbers and make no sence like "no of days" in fractoin 6.7 days .

I also want to know that if there is any method which can inserts some gap between the vertical able of the bar-chart and the scale .

Thanks in advance.

Awais Bajwa

Regards

Dave Gilbert

Re: Changing Bar Chart scale to whole numbers

Post by Dave Gilbert » Mon Oct 21, 2002 9:30 am

Hi Awais,

You can set the auto-tick-unit-selection mechanism to use integer only labels:

NumberAxis rangeAxis = (NumberAxis) myPlot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

The setLabelInsets(...) method in the Axis class can be used to increase the spacing around the axis label.

Regards,

DG

Locked