1 Reply Latest reply on Jan 29, 2008 3:02 PM by bueche

    Accessing x and y values (not coordinates) of event.hitdata

    bueche
      Here is my problem:

      <mx:LineChart id="chart2" dataProvider="{chartXML.lastResult.day}"
      width="435" height="309" x="23" y="10" showDataTips="true"
      itemClick="eventHandler(event)" >
      <mx:horizontalAxis>
      <mx:CategoryAxis dataProvider="{chartXML.lastResult.day}"
      categoryField="dayname" title="Day" />
      </mx:horizontalAxis>
      <mx:series>
      <mx:Array>
      <mx:LineSeries yField="category1_value" displayName="EMail" />
      <mx:LineSeries yField="category2_value" displayName="Database" />
      </mx:Array>
      </mx:series>
      </mx:LineChart>

      I need to pass data from hitdata to another program. I have successfully managed to get the displayName of the item clicked with the following:

      props = LineSeries(hitData.element).displayName

      This will give me "Email" or "Database" depending of course upon which datapoint I clicked.

      However, I can not find out how to get the value of the CategoryField.....or more properly the value of what CategoryField is refering to in the xml....which in this case is just a date value. In other words, I need to grab 2 values "email" and "Dec-01" (as an example). Any ideas? This is the xml:

      <day>
      <dayname>DEC-01</dayname>
      <category1_name>email</category1_name>
      <category1_value>149</category1_value>
      <category2_name>Database</category2_name>
      <category2_value>184</category2_value>
      </day>