开发者

Time Series chart X-axis Time display

I am wor开发者_开发知识库king 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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜