2 Replies Latest reply on Jan 20, 2009 7:06 PM by jrb1239

    1 Data Source two charts

      I am working on something that uses an ilog Elixir map. When you click on an object in the map I want to populate a pie chart and a bar chart with xml data. Currently I have the clcik of the map item filling the pie chart with xml data but I am not sure how to also send data to the pie chart at the same time.

      XML sample

      <state id="CA" >
      <data name="data1" value="3" />
      <data name="data2" value="5" />
      <data name="data3" value="10" />
      <funds name="city" value="1"/>
      <funds name="county" value="2"/>
      <funds name="state" value="3"/>

      On my map I use mapItemClick to send the data to the pie: mapItemClick="pie.dataProvider = xml.state.(@id == event.mapFeature.key).data"

      and the pie is set up to pull the name and value from the .data in the xml:

      <mx:PieChart showAllDataTips="true" left="20" bottom="20" width="100" height="100" >
      <mx:PieSeries id="pie" nameField="@name" field="@value" />

      Is it possible for that click to send .data (name and value) to the pie and .funds (name and value) to another chart? Any ideas? Thanks

        • 1. Re: 1 Data Source two charts
          matthew horn Level 3
          Maybe I am missing something obvious, but you can apply the same data provider to multiple chardts very easily. Something like:

          mapItemClick="pie.dataProvider = xml.state.(@id == event.mapFeature.key).data;otherchart.dataProvider = ..."

          In the other chart, define the series xField and yField appropriately.

          Note that you're not "sending" the data anywhere. You're just pointing a chart at an existing data provider, which in this case is defined in XML.

          matt horn
          flex docs
          • 2. Re: 1 Data Source two charts
            jrb1239 Level 1
            Thanks matt. I had tried your suggestion but I was using , instead of ; to separate the data providers.