1, the horizontal axis on the creation date details of the more common type A form of the horizontal axis is time, vertical axis is the value described. If the density in the data and time is not the case, there is no need to remove the database time string into a date type. But faced with a large span of time, and its value has distribution-intensive, horizontal axis shows the date the subject will be small enough to not see them. Then the most reasonable solution might be to use DateTimeAxis the dataUnits (time display unit is displayed on the horizontal axis the minimum time interval). This requires first of all LineChart the xField be converted into date type. Date object is to support the style of the string from the date of construction, but a limited number of:
Day Month Date Hours: Minutes: Seconds GMT Year (for instance, "Tue Feb 1 00:00:00 GMT-0800 2005", which matches toString ())
Day Month Date Year Hours: Minutes: Seconds AM / PM (for instance, "Tue Feb 1 2005 12:00:00 AM", which matches toLocaleString ())
Day Month Date Year (for instance, "Tue Feb 1 2005", which matches toDateString ())
Month / Day / Year (for instance, "02/01/2005")
Month / Year (for instance, "02/2005")
Depression is SqlServer 2000 supports the date output format does not have a match, better DateTimeAxis support the conversion of string to date:
private function parseToDate (s: String): Date (
/ / S = "2007-10-15 20:15"
var temp: Array = s.split ("");
var datepart: String = temp ;
var datearray: Array = datepart.split ("-");
var timepart: String = temp ;
var timearray: Array = timepart.split (":");
var newDate: Date = new Date (datearray , datearray , datearray , timearray , timearray );
This time span according to the size, you can adjust the horizontal axis the minimum time interval size. If the data reflect the year, you can set dataUnits Months, if the data reflect a month or several tens day oersted can be dataUnits set to days, and so on.