在线图上显示DateTime

时间:2009-09-08 14:47:21

标签: flex datetime linechart

我需要创建显示日期时间点的LineChart,例如:

public var stockDataAC:ArrayCollection = new ArrayCollection( [
                {date: "2005,7,27,22,15,30", close: 41.71},
                {date: "2005,7,27,22,16,30", close: 42.21},
                {date: "2005,7,27,22,17,30", close: 42.11},
                {date: "2005,7,27,22,18,30", close: 42.71},
                {date: "2005,7,27,23,22,30", close: 42.99},
                {date: "2005,7,27,23,24,30", close: 48.99},
                {date: "2005,7,27,23,25,30", close: 49} ]);

            public function myParseFunction(s:String):Date { 
                // Get an array of Strings from the comma-separated String passed in.
                var a:Array = s.split(",");
                // Create the new Date object. Subtract one from 
                // the month property because months are zero-based in 
                // the Date constructor.
                var newDate:Date = new Date(a[0],a[1],a[2],a[3],a[4],a[5],0);
                return newDate;
            }
           ......

           
                
            

如何使折线图显示标签/轴如下:27/7/2005 22:15:30?

1 个答案:

答案 0 :(得分:1)

看起来您正在尝试执行DateTimeAxis示例,但已修改。您需要将dataunits设置为“seconds”。