y-axis ranges problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
madhuri_ls
Posts: 10
Joined: Thu Jun 24, 2004 7:15 am

y-axis ranges problem

Post by madhuri_ls » Thu Jun 24, 2004 1:26 pm

Hi

i want to display y-axis ranges as 0,10,20,30.....
now its displaying 0,1,2,3,4....

Code :-

final CategoryDataset dataset1 = createDataset1();
final NumberAxis rangeAxis1 = new NumberAxis("Questions");
rangeAxis1.setAutoRangeIncludesZero(false);

final LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
renderer1.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());

final CategoryAxis domainAxis = new CategoryAxis("Student Test - 1");
final CategoryPlot subplot1 = new CategoryPlot(dataset1, domainAxis, rangeAxis1, renderer1);
subplot1.setDomainGridlinesVisible(true);




Please help

Thanks

RCDran
Posts: 29
Joined: Wed Feb 25, 2004 4:18 am
Location: Japan

Post by RCDran » Fri Jun 25, 2004 3:06 am

If you do a

Code: Select all

rangeAxis.setTickUnit(new NumberTickUnit(10.0));
then you can set the Tick in increment of 10.

Beaware: there is a down side of this, if your value in Range Axix is < 10 then you will not get any tick at all.
--
RCDran

Locked