ChartDirector点滴记录

ChartDirector表示时间是使用一个double类型,是当前时间到 1-1-0001 00:00:00的秒数.
具体信息可以参见:
http://localhost:8080/chartdir_java/doc/cdjavadoc/dateformat.htm
引用

Many functions in the ChartDirector API accept dates/times as parameters. ChartDirector represents dates/times as the number of seconds elapsed since 1-1-0001 00:00:00. The dates/times are numbers, so they can readily be used in ChartDirector APIs that expects numbers as arguments.

在java里, 应该java.util.Date经常用到, 所以给java的x轴的api里提供了java.util.Date的方法参数签名.
ChartDirector中从java.util.Date到Double(ChartDirector)内部的时间表示法之间的转换有下列方法可以使用
引用

public static double chartTime(int y, int m, int d [, int h [, int n [, int s ]]])

public static double CTime(java.util.Date time)

public static double[] CTime2(java.util.Date[] times)

public static java.util.Date NTime(double time)

public static java.util.Date[] NTime2(double[] times)


引用

The value 30 * 86400 will be assume to mean one month (which actually contains a variable number of seconds),
The value 60 * 86400 will be assumed to mean 2 months and so on.
The value 360 * 86400 therefore means 12 months, or 1 year.


猜你喜欢

转载自wen66.iteye.com/blog/1740784