how to set labels on y-axis in verticalxybarchart??

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

how to set labels on y-axis in verticalxybarchart??

Post by anu » Fri Aug 09, 2002 7:53 pm

i would like to put the values(5, 6, 7 , 8 ,9,10) on y-axis
and
dates on x-axis in VerticalXYBarChart.can any one help me how to do that.

thanks
anu

David Gilbert

Re: how to set labels on y-axis in verticalxybarchart??

Post by David Gilbert » Mon Aug 12, 2002 10:11 am

If you want to set a fixed tick unit size of 1, you can do this:

XYPlot plot = myChart.getXYPlot();
NumberAxis rangeAxis = (NumberAxis)plot.getRangeAxis();
rangeAxis.setTickUnit(new NumberTickUnit(1.0, new java.text.DecimalFormat("0")));

If you want auto tick unit selection with integer ticks only, this thread will help:

http://www.object-refinery.com/phorum-3 ... 673&t=3648

Regards,

DG.

Locked