1 Reply Latest reply on May 28, 2007 11:19 PM by KanadianKicker

    Getting the field value of a clicked on pie slice in a pie chart?

    KanadianKicker Level 1
      I have tried and searched for hours and can not get this simple little thing to work.

      I have a pie chart with the following event handler:

      itemClick="chart_click(event)"

      The pie series comes from a simple httpservice that has a country and a count:

      <mx:PieSeries
      field="count"
      nameField="value"
      labelPosition="callout"
      calloutGap="5"
      labelFunction="display"
      showDataEffect="{interpolate}">

      All I want to do is capture the value of the nameField (EG: Canada)

      I have no problem getting the index of the selected series but I can not get the nameField value of that slice. This is what I have:

      public function chart_click(e:ChartItemEvent):void
      {
      Alert.show(searchByPieChart.series[e.hitData.chartItem.index].nameField);
      }

      All I get is the string "value" which is the name of the xml tag bound to the nameField. What do I need to do ?