Customerized Minor Tick Count

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rishikanth
Posts: 6
Joined: Fri Nov 13, 2009 10:02 pm
antibot: No, of course not.

Customerized Minor Tick Count

Post by rishikanth » Fri Dec 11, 2009 7:46 pm

Hey Group,

I have been using Jfreechart 1.0.13 for last couple of days. I have checked out the new feature axis.setMinorTickMarksVisible(true) for showing the minor tick marks.
Now the problem is. On the dateAxis, I have choosen to setAutoRange(true) to display dates in the Axis.

My DateAxis start at 10/11(Minstart, not displayed), then 10/15 ( is displayed), 11/01 ( is displayed) and 11/05 ( last one, not displayed). So on the date axis I can only see 10/15 and 11/01 dates. Now I want to display MinorTicks between 10/11 - 10/15 (4), between 10/15-11/01 (16), and between 11/01 - 11/05 (4).

If I am using axis.setMinorTickCount(4). Only 4 minor ticks are displayed between the MajorTicks in dateAxis, but I need 16 in between some dates.

Can someone help me. Please let me know if I need to be more clear.

How Can i upload a image from my desktop ?

Thanks,

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Customerized Minor Tick Count

Post by paradoxoff » Sat Dec 12, 2009 4:47 pm

Call setMinorTickCount(16).
Minor ticks that are outside the axis range will not be drawn.

rishikanth
Posts: 6
Joined: Fri Nov 13, 2009 10:02 pm
antibot: No, of course not.

Re: Customerized Minor Tick Count

Post by rishikanth » Mon Dec 14, 2009 5:34 pm

What if all the dates are in Range for the DateAxis.

rishikanth
Posts: 6
Joined: Fri Nov 13, 2009 10:02 pm
antibot: No, of course not.

Re: Customerized Minor Tick Count

Post by rishikanth » Thu Dec 17, 2009 8:54 pm

Can someone please guide me with this issue. I tried saying setMinorTickCount(16), but if some dates are in range for the axis like 10/15 10/20 i want 4 minor ticks between them, but I get 16 as I use the above statement.

Help please.

Thanks,

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Customerized Minor Tick Count

Post by paradoxoff » Thu Dec 17, 2009 9:29 pm

A DateAxis (as any subclass of ValueAxis) will create the given number of minor ticks. If you want to change that, you will have to subclass DateAxis and override the refreshTicks, refreshTicksVertical and refreshTicksHorizontal methods.

Locked