How to set different range on X Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
warxsg
Posts: 2
Joined: Tue Jul 11, 2006 2:07 pm

How to set different range on X Axis

Post by warxsg » Tue Jul 18, 2006 3:08 pm

Hi,

i created a simple Line Chart following an example.
The chart has put on a PDF document as image.
JFreeChart set automatically the values on X and Y Axis, i want to define different range ont he Axis.
For instance :

the values on Y Axis are : 0,500,1000,1500,2000

the values on X Axis are : 0,50,100,150,200,250,300,350,400,450,500,600

I want to display values on X Axis such as : 0,10,20,30,40,50....

In this way my chart will more detailed.
Moreover my chart is not displayed clear, it seems that i have to set a scale or something like that.
Any suggestion ?

Cheers.

Stefano





[/img]

mst1978
Posts: 8
Joined: Wed Jul 19, 2006 3:35 pm

Post by mst1978 » Wed Jul 19, 2006 3:44 pm

I can not answer your first question.
I have the same problem!

But the second one:
Are you creating a JPG chart?
Please try PNG instead of JPG.
Then it looks MUCH better!

Bye,
Miroslav

willi.firulais
Posts: 15
Joined: Fri Jul 28, 2006 4:31 pm

setTickUnit

Post by willi.firulais » Wed Aug 02, 2006 9:21 am

Hello,

Tick unit for the axis is normally automatically selected from a collection of standard tick units. You may try this:

...
axis.setAutoTickUnitSelection(false);
axis.setTickUnit(new NumberTickUnit(50));
...

Hope that helps, Willi

Locked