3 Replies Latest reply on Jan 5, 2010 4:07 AM by LaVengeance

    How to Refresh a Panel with Chart

    Fis Forums Level 1

      Hi

       

      I need to refresh a panel which contains fusionchart charts in it

      I get my xml as stored dynamically when i claik on the panel

      If any xml updated the value should be reflected with a refresh on my chart

       

      So please help me int his

       

      Thenking You

       

      Gopinath.A

        • 1. Re: How to Refresh a Panel with Chart
          Madhav Subedi Level 4

          i think you need to change your arraycollection that is provided as the dataprovider to the chart.

           

          dont forget to declare the arraycollection bindable.

          • 2. Re: How to Refresh a Panel with Chart
            MSaharan

            changing the arraycollection doesnot refresh the loaded chart.

            Is there any other method.

            Kindly Help.I m new to flex.

            • 3. Re: How to Refresh a Panel with Chart
              LaVengeance

              If I understand your requirement correct, you want to update your charts whent the XML changes on the server ?

              If this is what you want then there's no way you can send the XML from your server to the frontend without an explicit call to it. There's no way of pushing data from the server to the client without a call form the client first.

               

              What you can do is poll for changes, you can add a timer to your panel/ application . you can set the time out interval ( 1 minute for example ) .

               

              example code below :

               

               

              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">

               

              <mx:Script>
                      <![CDATA[

               

               

                  private var timer:Timer;
                         
                          private function init():void{
                                 
                                  timer = new Timer(60000);    // 1 minute
                                  timer.addEventListener(TimerEvent.TIMER,refershGraphs);
                                  timer.start();


                        }



                  private function refershGraphs(event:TimerEvent):void{

               

                       

                        // update the dataproviders of your charts by reading the XML here

                            

                       // reset the timer and start it again         

                        timer.reset();           
                        timer.start();   

               

                  }


              ]]>
                  </mx:Script>


              </mx:Application>

               

               

               

               

              let me know if your requirement is different from what I've understood.