If you add this line
axis.setTickUnit(new org.jfree.chart.axis.DateTickUnit
(org.jfree.chart.axis.DateTickUnit.MONTH, 1));
after line:
DateAxis axis = (DateAxis) plot.getDomainAxis();
in TimeSeriesDemo.java, and run it, you'll see the tick
labels are overlapped. I put some code into ValueAxis to
allow tick label overlapping detection. However the
gridlines will still be drawn even the overlapped tick
labels are not shown. In some cases, this is desired, but
sometimes the grid lines are to dense. It is may be
better to move the tick label overlapping detection to a
seperate method and let method refreshTicks() in the
subclass to call the tick label overlapping detection.
Other consideration is adding a flag into ValueTick to
indicate where the ValueTick is shown or not and let the
plot to draw all grid lines or just the grid lines with tick
label shown.
updated ValueAxis.java
Logged In: YES
user_id=977710
Discard this. see http://sourceforge.net/tracker/index.php?
func=detail&aid=933845&group_id=15494&atid=315494 for
new implementation for both item and tick label overlap
detection