I need to change the default DateTickUnit settings for different zoom levels for a TimeseriesChart, but can´t find the place i need to read in the documentation? I would greatly appreciate a pointer.
2 Answers
Here is the Java API for TimeSeriesChartDemo1: http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/demo/TimeSeriesChartDemo1.html
The zoom levels documentation will be found in one of the inherited methods. I would recommend finding the exact component that requires the zoom to be changed on. Then checking the API for that java.awt component

- 281
- 2
- 9
-
Actually, it's [`BarChartDemo1`](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/demo/BarChartDemo1.html) that illustrates `setStandardTickUnit()`, as shown [here](http://www.jfree.org/jfreechart/api/javadoc/src-html/org/jfree/chart/demo/BarChartDemo1.html#line.64). – trashgod Jun 15 '11 at 00:20
DateAxis
has two static factories for creating standard date tick units. These methods, createStandardDateTickUnits()
, describe how "to create your own collection." The setTickUnit()
methods replace the default with your own DateTickUnit
. The constructor having a DateFormat
is particularly convenient.
If this is terra incognita, I'd recommend The JFreeChart Developer Guide†.
†Disclaimer: Not affiliated with Object Refinery Limited; just a satisfied customer and very minor contributor.

- 203,806
- 29
- 246
- 1,045
-
I got the guide, will spend some grey matter on it. Long read, though :) – Jannis Alexakis Jun 15 '11 at 09:07
-
Excellent; IIRC, there's an example under `org.jfree.chart.axis.DateTickUnit`. I'm surprised you have to change the units for zoom; you may be able to change just the format. – trashgod Jun 15 '11 at 19:27