HOW can I FIXED my Scale

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jumister
Posts: 3
Joined: Wed Mar 29, 2006 2:30 pm

HOW can I FIXED my Scale

Post by jumister » Wed Mar 29, 2006 7:59 pm

can someone tell me how I can fix my label axis scale!?

for an example i want that my axis label domain(scale) goes to 20 in 20, something like this,

|____|_____|_____|_____|
0 20 40 60 80

and not automatically.


thanks in advance.[/img]

gribas
Posts: 32
Joined: Thu Jan 26, 2006 5:34 pm

Post by gribas » Thu Mar 30, 2006 8:54 pm

If its a number axis (which I think it is) you can call the setTickUnit method.

Code: Select all

 NumberAxis domainAxis = (NumberAxis) chart.getXYPlot().getDomainAxis();
 domainAxis.setTickUnit(new NumberTickUnit(20,new DecimalFormat("0"));

Locked