How to change tick unit?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
RCDran
Posts: 29
Joined: Wed Feb 25, 2004 4:18 am
Location: Japan

How to change tick unit?

Post by RCDran » Mon Dec 06, 2004 12:10 pm

I want to set the tick unit to a fixed value, if the tick Unit is less than some arbitrary value.

Say if the tick Unit is less than 10, I need to set the value as 10 or else I need to use the tick Unit set by jFree.

Could some body let me know as to how to do this?

200 -
150 -
100 -
50 -
0
above needs to be left as it is.

20 -
15 -
10 -
05 -
00 -
above needs to be modified as
20 -
10 -
00 -
--
RCDran

Guest

Post by Guest » Mon Dec 06, 2004 3:04 pm

Incidentally, could some body let me know how to find the TickUnit's size.

When I do TickUnit.getSize(), this always returns 1.0 where the tick I see in the graph is not so.

Guest

Post by Guest » Tue Dec 14, 2004 6:25 pm

I had made selectVerticalAutoTickUnit() method public and extended Number Axis class and set the tickUnit to be desired value when the calculated TickUnit is less than a certain value.

Hope it helps...for the person who struggles like me...

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Wed Dec 15, 2004 8:12 am

This is how I set the the tickunit:

Code: Select all

rangeAxis.setTickUnit(new NumberTickUnit(50000));

Locked