Hi, I've been trying to figure this out for a while now. I have a
basic chart that I want to be able to select a different data source
for each series. I have a test app where all I want to do is change
the charts dataprovider via a combo box;

 <mx:ComboBox id="choosekit" x="10" y="23" width="210"
dataProvider="{samplepoint}"
     labelFunction="getListLabel" prompt="Click to Select..."
change="trendingchangeHandler(event)" selectedIndex="0">
     </mx:ComboBox>
...
   
     <mx:LineChart x="281" y="14" id="linechart1"
dataProvider="{samplepointdp}" showDataTips="true">
          <mx:series>
               <mx:LineSeries id="series1" displayName="Series 1"
yField="{series1dp}"/>
               <mx:LineSeries id="series2" displayName="Series 2"
yField="{series2dp}"/>
          </mx:series>
     </mx:LineChart>
     <mx:Legend dataProvider="{linechart1}" x="188" y="309"/>

...
[Bindable]
private var samplepointdp:String

private function trendingchangeHandler(event:Event):void
{
samplepointdp = choosekit.selectedItem.Test_Kit_Used;
                                                 
}
...

If I statically set the dataprovider and load the app, it connects to
the db and populates the chart. I can then use combobox's to change
the yAxis of each of the series, works as expected. Now I'm assuming
the same can be done with the dataprovider, but I see that when the
app first loads, there is just the slightest pause while the chart
connects to the db and loads. So I'll assume that when I change the
dataprovider in the app, I must then refresh the chart to load the new
data? But how?

Thanks, 

Reply via email to