0 Replies Latest reply on Sep 21, 2006 12:11 PM by pythonluv

    parseFunction in DateTimeAxis

    pythonluv Level 1
      I am struggling with parseFunction in DateTimeAxis.. can someone help me ?
      my xml goes like this..
      <Data id="q">
      <time>2006/5/23 12:00:00</time>
      <time>2006/5/23 12:45:00</time>
      <time>2006/5/23 13:30:00</time>
      <Data id="x">
      <time>2006/5/23 13:00:00</time>
      <time>2006/5/23 13:22:00</time>
      <time>2006/5/23 13:24:00</time>

      I am trying to display these 2 sets of data in above xml file to lineChart from Minimum 12:00 , Maximum 13:20 in w lineSeries. (using DateTimeAxis for X-axis so I can specify the interval. )

      now. since the date format is not what flex wants.. I am changing the date format to yyyy-mm-dd hh:mm:ss
      using parseFunction

      public function myParseFunction(s:String):Date {
      var temp:String = s.replace(/\//gi,"-")
      return newDate = new Date(temp)

      now.. when I debug.. I keep seeing the extra integer values on top of the dates I passed in.

      Does anyone have idea why ?

      Below.. sort of summarize what I do..

      <mx:DateTimeAxis parseFunction="myParseFunction"/>

      <mx:LineSeries dataProvider="{xxx}" xField="time" displayName="Time"/>
      <mx:LineSeries dataProvider="{xxx}" yField="Value" form="segment" / >
      <mx:LineSeries dataProvider="{xxx2}" yField="Value" form="segment"/ >