如何设置TimeSeriesChart时间格式 [英] How to set up TimeSeriesChart time format

查看:531
本文介绍了如何设置TimeSeriesChart时间格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(1)如何设置TimeSeriesChart时间轴格式,类似于yyyy-MM-dd HH:mm:ss,HH:mm:ss,HH:mm:ss," yyyy-MM-dd HH:mm:ss在图表中?

(2)如果是在同一天,只有yyyy-MM-dd HH:mm:ss的第一次格式,另一种是HH :mm:ss",直到另一天。

(3)例如,TimeSeriesChart的时间轴格式为2008-02-08 09:00:00,10:00 :00"," 11:00:00"," 2008-02-09 09:00:00"。

(4)如果有人有一个答案或代码?

(1)How to set up TimeSeriesChart time axis format similar to "yyyy-MM-dd HH:mm:ss", "HH:mm:ss", "HH:mm:ss", "yyyy-MM-dd HH:mm:ss" in a chart?
(2)If it is on the same day, only the first time format for the "yyyy-MM-dd HH:mm:ss", the other for "HH:mm:ss", until another day.
(3)For example, a time axis format for TimeSeriesChart is "2008-02-08 09:00:00", "10:00:00", "11:00:00", "2008-02-09 09:00:00".
(4)If someone have a piece of answer or code ?

推荐答案

就我而言,这将为你做一切,由你决定你的逻辑模型,对象如下:


SimpleDateFormat formatter = new SimpleDateFormat(&'E yyyy.MM.dd''at''hh:mm:ss a zzz");


其中:eg


日期和时间模式结果

" yyyy.MM.dd G''''HH:mm:ss z" 2001.07.04 AD at 12:08:56 PDT

EEE,MMM d,''''yy"星期三,7月4日,''01

" h:mm a" 12:08 PM

" hh''''''''''''a,zzzz"太平洋夏令时下午12点

K:mm a,z 0:08 PM,PDT

" yyyyy.MMMMM.dd GGG hh:mm aaa" 02001.July.04 AD 12:08

" EEE,d MMM yyyy HH:mm:ss Z" 2001年7月4日星期三12:08:56 -0700

" yyMMddHHmmssZ" 010704120856-0700


亲切的问候:Sam Rabophala
as far as I am concerned this will do everything for you, it is up to you how you model your logic, the object is like:

SimpleDateFormat formatter = new SimpleDateFormat("E yyyy.MM.dd ''at'' hh:mm:ss a zzz");

where: e.g.

Date and Time Pattern Results
"yyyy.MM.dd G ''at'' HH:mm:ss z" 2001.07.04 AD at 12:08:56 PDT
"EEE, MMM d, ''''yy" Wed, Jul 4, ''01
"h:mm a" 12:08 PM
"hh ''o''''clock'' a, zzzz" 12 o''clock PM, Pacific Daylight Time
"K:mm a, z" 0:08 PM, PDT
"yyyyy.MMMMM.dd GGG hh:mm aaa" 02001.July.04 AD 12:08 PM
"EEE, d MMM yyyy HH:mm:ss Z" Wed, 4 Jul 2001 12:08:56 -0700
"yyMMddHHmmssZ" 010704120856-0700

kind regards: Sam Rabophala


感谢您的回复..

但它不是我的结果..

我的意思是两种时间格式的TimeSeriesChart ..

如何设置?
Thank you for your reply..
But It is not my result..
I mean that a TimeSeriesChart on the two time format..
How to set up ?


好吧,如果TimeSeriesChart是一个jfreechart而且它没有适合你需要的setter方法,那么你必须使用可以根据需要设置时间的方法实现自己的TimeSeriesChart,你所需要做的就是扩展TimeSeriesChart和重复使用所有功能而不需要额外的里程。


希望这会对你有所帮助...


亲切问候:Sam rabophala
well, if TimeSeriesChart is a jfreechart and it doesn''t have a setter method that suit your need, then you must implement your own TimeSeriesChart with method(s) that can set time as you want, all you need to do is to extend TimeSeriesChart and reuse all functionality without going extra miles.

hope this will helps you...

kind regards: Sam rabophala


这篇关于如何设置TimeSeriesChart时间格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆