4 Replies Latest reply on Aug 19, 2009 1:55 AM by PiyushChitkara

    Custom Clickable Charts Objects and Legends

    PiyushChitkara

      Hi,

       

      The Requirement is a little bit weird but urgent as well .

       

      Well all I need is a complete flexible chart where each element on x-axis or each element on y-axis is clickable. Also, considering I am using a bar chart. I would want to click on the bar and get more details on the Data giving deep analysis on how we got such a number.

       

      Even the legend of the graph should be clickable in this case.

       

      For Example

      Chart.JPG

       

      In This case Gold, Silver and Bronze on the legend should be clickable which would generate more data.

      Also, 'USA','China','Russia' and the bars depicting the corresponding values should be clickable.

       

       

      Please let me know if I am not clear.

      Many Thanks,

      Piyush

        • 1. Re: Custom Clickable Charts Objects and Legends
          flexprad09 Level 2

          You can click on Bars and legend with help of default change & click properties like below:

           

          <mx:ColumnChart id="myChart"
                  dataProvider="{YourDataProvider}" 
                  selectionMode="single"  ///or multiple as you wish
                  change="Alert.show('hi i am Bar')"
               >

           

          <mx:Legend dataProvider="{YourDataProvider}" click="Alert.show('hi i am  legend')"/>   .// in place of alert you can call your Function

           

          While for Axis click I think probably you have to use AxisRenderers but still i am not sure if renderers support click or not.

           

          check this

          http://livedocs.adobe.com/flex/3/langref/mx/charts/AxisRenderer.html

          it may help.

           

          If this post answers your question or helps, please mark it as such.

           

          Cheers,

           

          Prad.

          • 2. Re: Custom Clickable Charts Objects and Legends
            PiyushChitkara Level 1

            Hi Prad,

             


            Understood what actually you are saying here.

             

            Could you tell me how to extract the tooltip text when I point to the Column in the chart...?

            In this case I am using the event object of 'ChartItemEvent' class andI dont think it is possible

             

            FYI -- In Legends I am using object of 'LegendEvent' class and in order to get the text when I point at the legend it goes somethign like this

            Alert.show(event.item.label.toString()); ..

             

             


            Many Thanks,

            Piyush

            • 3. Re: Custom Clickable Charts Objects and Legends
              PiyushChitkara Level 1

              Hi Prad,

               


              Understood what actually you are saying here.

               

              Could you tell me how to extract the tooltip text when I point to the Column in the chart...?

              In this case I am using the event object of 'ChartItemEvent' class andI dont think it is possible

               

              FYI -- In Legends I am using object of 'LegendEvent' class and in order to get the text when I point at the legend it goes somethign like this

              Alert.show(event.item.label.toString()); ..

               

               


              Many Thanks,

              Piyush

              • 4. Re: Custom Clickable Charts Objects and Legends
                PiyushChitkara Level 1

                Also there is nothing like some special even like 'itemMouseDown' in AxisRender. All I get is a click event which gives me general properties..

                Can there be a work around for this?

                 

                Many Thanks,

                Piyush