RE: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
The DateTimeAxis uses the built in ECMAScript Date parsing function to convert strings to dates. So if your dates are in a different format, you need to provide your own parsing function. Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of munkydung Sent: Monday, February 26, 2007 10:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis wow, that was totally it. thanks! I was under the impression that Flex was interpreting my date values just fine as it rendered appropriate values in my third example, but I guess we have to be explicit about it. Mike --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Mark [EMAIL PROTECTED] wrote: I was having the same problem and found from the help files I needed to make sure my dates were coming in as dates, so there's a parseFunction I needed to add, like this: mx:horizontalAxis mx:DateTimeAxis labelUnits=months dataUnits=days displayLocalTime=true parseFunction=myParseFunction / /mx:horizontalAxis //function 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. var newDate:Date = new Date(a[0],a[1],a[2]); return newDate; } Hope it helps
Re: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
On Monday 26 Feb 2007, Ely Greenfield wrote: The DateTimeAxis uses the built in ECMAScript Date parsing function to convert strings to dates. So if your dates are in a different format, you need to provide your own parsing function. Plug :-) http://thefalken.livejournal.com/40103.html -- Tom Chiverton Helping to administratively network value-added paradigms at http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. Yahoo! Groups Sponsor ~-- Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/kOt0.A/gOaOAA/yQLSAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
Just a general note to anyone reading this, remember that months in ActionScript dates are 0-indexed. new Date(2007,2,25) is actually March 25th, not February as you would expect. Here is my parseDate function which converts date strings from -MM-DD format into a Date object. public function parseDate(s:String):Date { if (!s) return null; var a:Array = s.split('-'); return new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2])); } Hope that helps someone along the way. Cheers, Adam - Original Message - From: Mark To: flexcoders@yahoogroups.com Sent: Sunday, February 25, 2007 10:37 PM Subject: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis I was having the same problem and found from the help files I needed to make sure my dates were coming in as dates, so there's a parseFunction I needed to add, like this: mx:horizontalAxis mx:DateTimeAxis labelUnits=months dataUnits=days displayLocalTime=true parseFunction=myParseFunction / /mx:horizontalAxis //function 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. var newDate:Date = new Date(a[0],a[1],a[2]); return newDate; } Hope it helps
Re: [flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
On Sunday 25 Feb 2007, Adam Royle wrote: public function parseDate(s:String):Date { if (!s) return null; var a:Array = s.split('-'); return new Date(parseInt(a[0]),parseInt(a[1])-1,parseInt(a[2])); } Might be better with a regular expression etc etc here, what happens if you give it 2007-45-45 or 2007--5-5 :-) -- Tom Chiverton Helping to heterogeneously brand third-generation design-patterns at http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. Yahoo! Groups Sponsor ~-- Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/4It09A/fOaOAA/yQLSAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
wow, that was totally it. thanks! I was under the impression that Flex was interpreting my date values just fine as it rendered appropriate values in my third example, but I guess we have to be explicit about it. Mike --- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] wrote: I was having the same problem and found from the help files I needed to make sure my dates were coming in as dates, so there's a parseFunction I needed to add, like this: mx:horizontalAxis mx:DateTimeAxis labelUnits=months dataUnits=days displayLocalTime=true parseFunction=myParseFunction / /mx:horizontalAxis //function 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. var newDate:Date = new Date(a[0],a[1],a[2]); return newDate; } Hope it helps
[flexcoders] Re: broken: stacked AreaChart when using horizontal DateTimeAxis
I was having the same problem and found from the help files I needed to make sure my dates were coming in as dates, so there's a parseFunction I needed to add, like this: mx:horizontalAxis mx:DateTimeAxis labelUnits=months dataUnits=days displayLocalTime=true parseFunction=myParseFunction / /mx:horizontalAxis //function 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. var newDate:Date = new Date(a[0],a[1],a[2]); return newDate; } Hope it helps