반응형
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:DateFormatter id="df" formatString="JJ:NN:SS" />
<mx:Script>
<![CDATA[
private const minimum:Date = new Date( "Apr 1 2011 01:03:54 AM");
private const maximum:Date = new Date( "Apr 1 2011 03:07:54 AM");
private function labelFunction(item:Object,
field:String,
index:Number):String {
return df.format(item as Date);
}
]]>
</mx:Script>
<mx:CartesianChart width="600" height="200">
<mx:horizontalAxis>
<mx:DateTimeAxis
minimum = "{minimum}"
maximum = "{maximum}"
displayLocalTime="true"
labelFunction="labelFunction"
labelUnits="minutes"
/>
<!--
interval="15"
-->
</mx:horizontalAxis>
</mx:CartesianChart>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:DateFormatter id="df" formatString="JJ:NN:SS" />
<mx:Script>
<![CDATA[
private const minimum:Date = new Date( "Apr 1 2011 01:03:54 AM");
private const maximum:Date = new Date( "Apr 1 2011 03:07:54 AM");
private function labelFunction(item:Object,
field:String,
index:Number):String {
return df.format(item as Date);
}
]]>
</mx:Script>
<mx:CartesianChart width="600" height="200">
<mx:horizontalAxis>
<mx:DateTimeAxis
minimum = "{minimum}"
maximum = "{maximum}"
displayLocalTime="true"
labelFunction="labelFunction"
labelUnits="minutes"
/>
<!--
interval="15"
-->
</mx:horizontalAxis>
</mx:CartesianChart>
</mx:Application>
Gives this