Reputation: 41
I am working on TimeSeries in jfreechart and in this chart time is represented as hh:mm:ss. But when I start time from 00:00:00, chart shows the start time 12:00:00 and it rotates after 24 hour, but I do not want rotation of time such I want to see 25:00:00 in place of 1:00:00. Is there any solution for these problems?
Thanks in advance.
Upvotes: 1
Views: 2515
Reputation: 21
dont know if you still wanna know about that, but you can just use something like this:
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setAutoRange(true);
axis.setDateFormatOverride(new SimpleDateFormat("HH:mm"));
By using HH instead of hh you force SimpleDateFormat to write the date in 24h format.
Hope it helps! Cheers
Upvotes: 2
Reputation: 33078
Create your own TimeSeriesDataModel
to use with the chart. Override the getValueAt
method in your class to return a string formatted the way you want.
Upvotes: 1