1 Reply Latest reply on May 22, 2006 12:44 PM by maxkool

    loading different charts at different intervals

      hello all! i have had a great deal of hlep from the folks here at the forum and i have even posted some of the solutions. i have one more issue that is making me crazy. i know how to use setinterval to call a data service and what not. what i cant seem to figure out is how would i call lets say different charts at different intervals. for example my data is split into 7 categories (each with 6 data points), my end uses dont want a huge chart with all the data crammed in there. so, they want the chart to cycle through the catergories automatically. like i said i can set up a combo box so it sends the category with right data but how do i set it up so it runs by itself. do i set up an array with the different charts? of is there a way to step through data? once again i come humble before you looking for that magic guidance!!!


        • 1. Re: loading different charts at different intervals
          maxkool Level 1
          ok i guess i should post what im trying to do:

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Canvas xmlns:mx=" http://www.macromedia.com/2003/mxml" marginLeft="0"
          height="100%" width="100%"
          initialize="myHTTPData.send();trace('calling service');" backgroundColor="#cccccc"
          <mx:HTTPService url=" http://datasource id="myHTTPData" method="GET" result="refreshdata" >
          var data: String; // Set default value if none is passed.
          var datasub: String;


          var cards = [ {label:"Murder", data:"Murder"}, {label:"Rape", data:"Rape"}, {label:"Fel Assault", data:"FelAssault"}, {label:"Robbery", data:"Robbery"}, {label:"Burglary", data:"Burglary"}, {label:"Gr.Larceny", data:"GrLarceny"}, {label:"G.L.A", data:"GLA"} ];

          var selectedItem bject;


          function getPreferredHeight()
          return _parent.layoutHeight;
          function getPreferredWidth()
          return _parent.layoutWidth;


          import mx.servicetags.HTTPService;
          function startApp()
          function refreshdata()


          <mx:SeriesInterpolate duration="1000" minimumElementDuration="200" elementOffset="0" name="rearrangeData" />

          <mx:HBox >
          <mx anel title="Crime stats" >
          <mx:ColumnChart id="linechart" dataProvider="{myHTTPData.result.expenses}" showDataTips="true" width="530" height="280" >
          <mx:CategoryAxis dataProvider="{myHTTPData.result.expenses}" categoryField="Month"/>
          <mx:ColumnSeries yField="Count" showDataEffect="rearrangeData" name="{categories.selectedItem.data} 2006" >
          <mx:SolidColor color="green" />
          <mx:ColumnSeries yField="Expenses" showDataEffect="rearrangeData" name="{categories.selectedItem.data} 2005">
          <mx:SolidColor color="blue"/>
          <mx:VBox> <mx:Legend dataProvider="linechart"/>
          <mx:Label text="Categories" />
          <mx:ComboBox id="categories" dataProvider="{cards}" change="selectedItem=event.target.selectedItem">


          </mx anel>

          I would like to be able to have the chart scroll through each category in the combo box automatcially.

          thanks for any help