I'm using the following function to draw the line chart with Datetime
axis
private function drawGraph () :void {
_chart = new LineChart();
_chart.showDataTips = true;
_chart.dataProvider=nodeList;
_chart.width=374;
_chart.height=283;
var dt:DateTimeAxis = new DateTimeAxis();
dt.dataUnits="days";
dt.interval = 0.5;
dt.parseFunction=myParseFunction;
// dt.labelFunction = labelFunc;
_chart.horizontalAxis = dt;
}
private function myParseFunction(s:String):Date {
var str:Array = s.split("/");
var a:String = str[2];
var splitArr:Array = a.split(":");
var newDate:Date = new Date(splitArr[0],str[0]-1,str
[1],splitArr[1],0,0); //format of my date/time is date="04/23/2009:14"
which i get from xml response element
// var newDate:Date = new Date(null,str[0]-1,null,splitArr[1],
0,0);
return newDate;
//return formatDate.format(newDate);
}
I need to display 04/23/2009:14 along horizontal axis on the line
chart with date and time as given using DateTimeAxis.
On May 14, 10:55 pm, Rahul <[email protected]> wrote:
> HI,
> is this what you are looking for...
>
> <?xml version="1.0"?>
> <!-- formatters\FormatterDateField.mxml -->
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
>
> <!-- Declare a DateFormatter and define formatting parameters.-->
> <mx:DateFormatter id="dateFormatter"
> formatString="month: MM, day: DD, year: YYYY"/>
>
> <mx:Label text="Enter date (mm/dd/yyyy):"/>
> <mx:TextInput id="dob" text=""/>
>
> <mx:Label text="Formatted date: "/>
> <mx:TextInput id="formattedDate"
> text=""
> editable="false"/>
>
> <!-- Format and update the date.-->
> <mx:Button label="Format Input"
> click="formattedDate.text=dateFormatter.format(dob.text);"/>
> </mx:Application>
>
> On Fri, May 15, 2009 at 10:11 AM, Vinoth <[email protected]> wrote:
>
> > I have a requirement that i need to display the Date/Time format as MM/
> > DD/YY :HH along the horizontal axis. I have Data function and label
> > function. I'm not sure how to display this formatted date.
>
> > I tried using DateTimeAxis it doesnt work well. Any suggestions or
> > examples on how to do this would be appreciated.
>
> > Thanks in advance !
>
> --
> Regards
> Rahul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---