1 Reply Latest reply on Nov 30, 2007 12:42 PM by ntsiii

    Switchin between XML files for chart

    spacehog Level 1
      I have a chart that is reading from an XML file. I would like to give the user the ability to click a radio button and switch the URL attribute in the HTTPService tag to the other XML file. I have tried writing a function, but it does not seem to change the URL.

      <mx:HTTPService id="usageService" url="Data/usage.xml" result="resultHandler(event)"/>
      <mx:DataGrid dataProvider="{myData}" x="35" y="28" width="350">
      <mx:DataGridColumn dataField="day" headerText="Date" width="250"/>
      <mx:DataGridColumn dataField="license" headerText="Licenses" textAlign="right" />
      <mx:ColumnChart dataProvider="{myData}" x="35" y="194" id="usageChart" height="248" showDataTips="true">
      <mx:ColumnSeries displayName="licenses" xField="day" yField="license"/>
      <mx:Legend dataProvider="{usageChart}" x="443" y="178"/>
      <mx:HBox x="443" y="239">
      <mx:RadioButton groupName="weeks" label="Week 1" selected="true" click="usageService.url='Data/usage.xml'"/>
      <mx:RadioButton groupName="weeks" label="Week 2" click="usageService.url='Data/usage2.xml'"/>