I have a timeseries chart that displays data over a number of
days. The X-axis has a resolution of one hour which cannot change.
Once the timeseries grows beyond three or four days dates are
displayed at the midnight of each day. My question is how can I
change it to display the dates once there is more than one day of
data?
dates on x-axis
Re: dates on x-axis
You have two options, both will require a little work:
1) Create your own TickUnits collection and pass it to the setStandardTickUnits(...) method in the DateAxis class. This leaves JFreeChart to "auto-select" the tick unit, you'll need to choose your tick units carefully.
2) Set the tick unit on the axis manually, and update it yourself when the dataset range reaches the required threshold.
Neither of these solutions is ideal, but when it comes to tick labels the transition from one day to multiple days on the axis is not easy to handle...
Regards,
Dave Gilbert
1) Create your own TickUnits collection and pass it to the setStandardTickUnits(...) method in the DateAxis class. This leaves JFreeChart to "auto-select" the tick unit, you'll need to choose your tick units carefully.
2) Set the tick unit on the axis manually, and update it yourself when the dataset range reaches the required threshold.
Neither of these solutions is ideal, but when it comes to tick labels the transition from one day to multiple days on the axis is not easy to handle...
Regards,
Dave Gilbert