FLEX + Line Chart + Date Display

I am testing creating a line graph with Flex 3 - it has 4 series and everything display properly but the date on the horizontal axis display month/year - where i want it to display as mm/dd/yyyy, the tutorial i was following uses the below code.  The date format from the xml is mm/dd/yyyy but i am guessing is a string so needs to convert it to a date, but it doesnt seem to display correctly in the graph.
// Create a DateTimeAxis horizontal axis.
		            var hAxis:DateTimeAxis = new DateTimeAxis();
		            hAxis.dataUnits = "WeekDate";
		            // Set this to false to display the leftmost label.
		            hAxis.alignLabelsToUnits = false;
		            // Take the date in its current format and create a Date
		            // object from it.
		            hAxis.parseFunction = createDate;
		            myChart.horizontalAxis = hAxis;



		        public function createDate(s:String):Date {
		            // Reformat the date input to create Date objects
		            // for the axis.
		            var a:Array = s.split("/");
		            
		            // The existing String s is in the format "MM/DD/YYYY". 
		            // To create a Date object, you pass "YYYY,MM,DD", 
		            // where MM is zero-based, to the Date() constructor.
		            var newDate:Date = new Date(a[2],a[0]-1,a[1]);
		            return newDate;
		        }

Open in new window

dkilbyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

vindys80Commented:
Hi,

I think you will get it correct if you specify dataUnits to days.

hAxis.dataUnits = "days";


http://livedocs.adobe.com/flex/3/html/help.html?content=charts_intro_7.html

Thanks,
Vindys

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dkilbyAuthor Commented:
great thanks - i also had to add hAxis.labelUnits = "days';
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Flex

From novice to tech pro — start learning today.