3 Replies Latest reply on Mar 8, 2009 1:38 PM by VIV321

    Flex Charts with continuously changing data

    VIV321
      Hi

      I want to create a flex chart ( line chart ) , but it should not be a static chart. The data of the chart will be continuously changing like stereaming stock ticker. How do I do that so that user see the line charts moving, progressing as time passes?

      Thanks

        • 1. Re: Flex Charts with continuously changing data
          Level 7

          "VIV321" <webforumsuser@macromedia.com> wrote in message
          news:gous55$95u$1@forums.macromedia.com...
          > Hi
          >
          > I want to create a flex chart ( line chart ) , but it should not be a
          > static
          > chart. The data of the chart will be continuously changing like stereaming
          > stock ticker. How do I do that so that user see the line charts moving,
          > progressing as time passes?
          check out the chart sampler at quietlyscheming.com


          • 2. Re: Flex Charts with continuously changing data
            atta707 Level 2
            So, you'll be using Timer class to to periodically run some code that will get new data from the server.

            You already have chart rendered. All you have to do is to reset the dataProvider your chart. Of course, you'll be using some kind of transition effect to make it look nice. SeriesSlide should be a good starting transition.

            HTH.

            ATTA
            • 3. Re: Flex Charts with continuously changing data
              VIV321 Level 1
              Thanks ATTH, that helped. I am now able to use Timer to resend HTTPService Get and the Line Chart does indeed refresh. Only thing the effect is not very cool and smooth. I tried to use the SeriesSlide transition effect as per your suggestion but that did not help much. Perhaps I am not using it right. This is what I have:
              <mx:HTTPService
              id="srv"
              url=" http://localhost:7777/linechart"
              useProxy="false"
              result="handleResult(event)" method="GET"
              />
              <mx:SeriesSlide id="slideIn" direction="right" duration="1000"/>
              <mx:Panel title="Sample Line Chart">
              <mx:LineChart id="myChart" dataProvider="{myData}" showDataTips="true" showEffect="slideIn" >
              <mx:horizontalAxis>
              <mx:CategoryAxis categoryField="time"/>
              </mx:horizontalAxis>
              <mx:series>
              <mx:LineSeries yField="Series1" displayName="Item1" name="Item1"/>
              <mx:LineSeries yField="Series2" displayName="Item2" name="Item2"/>
              <mx:LineSeries yField="Series3" displayName="Item3" name="Item3" />
              </mx:series>
              </mx:LineChart>

              I tried to use the showDataEffect on individual Line Series, but it redraws the entire line again and slides. Any tips how to make it look better.

              Thx