How can I set the first shown value of the Axis (TickMark)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gummibear
Posts: 4
Joined: Wed Apr 11, 2007 4:29 pm
Location: Germany
Contact:

How can I set the first shown value of the Axis (TickMark)

Post by gummibear » Mon Feb 04, 2008 11:08 am

Hello,

I have create a axis with range 20 to 300 and TickUnit 40.

Code: Select all

NumberAxis xaxis = (NumberAxis)plot.getDomainAxis();
xaxis.setTickUnit(40);
xaxis.setRange(20,300);
xaxis.setAutoRangeIncludesZero(false);
Now, the axis shows the values 40, 80, 120, .. , 240, 280, but the axis shall show the values 20, 60, 100, 140, ... , 260, 300.

Have anybody an idea, how can I solve this problem / set the first shown value to 20?
Thanks for your help.

bye

nimowy
Posts: 19
Joined: Fri Jan 25, 2008 10:16 pm

Post by nimowy » Mon Feb 04, 2008 3:41 pm

That's strange, setRange worked perfectly for me... maybe set the beginning range to 19 and see if the 20 showed up? We had a clipping problem at the top of our range, so I just added 5 to the top of the range and anyone who scored 100% will now show the full box.

gummibear
Posts: 4
Joined: Wed Apr 11, 2007 4:29 pm
Location: Germany
Contact:

Post by gummibear » Mon Feb 04, 2008 7:04 pm

Hello nimowy,

thanks for your fast reply.

I think, I have articulate wrong.

The setRange worked perfectly for me, too. ( I tried setRange(19, 301), but the values are displayed wrong.)
I mean the NumberTickLabels, which shows the wrong values.

Here is a picture:

Image

You can see the displayed values 40, 80, 120, ..., but I want that the values 20, 60, 100, ... are displayed

bye

Locked