This content has been marked as final. Show 4 replies
you have to provide the DateTimeAxis with a "labelFunction" ( DateTimeAxis-Doc).
In this function you can check e.g. a global flag (or the value of a CheckButton, ...), take the parameter labelValue and then create and return a string in a format you like.
Can you please give some more details and an example? I cant quite understand your point here.
Just in case that I misunderstand your question:
You want to know how to format the labels of an DateTimeAxis (and switch between two formats - time and date), right?
You could do this e.g.: #see attached code#
In the label-function you get the label as a Date-object and create a string depending on the setting of the CheckBox.
"change="linechart1.invalidateDisplayList(); linechart1.validateNow()" makes the chart update (there might be a better way to do so ...)
If this is not what you wanted to know ... forget this post :-)
What you gave me works as well. But I also found this :
In the DateTimeAxis, we have the following attributes which do the same task as you suggested.
<mx:DateTimeAxis dataUnits = "days" displayLocalTime= true dataInterval = 1/>
I am using this and its working fine till now.