Hello,

im facing a problem regarding DataTipRenderer of a chart.

in the application i have two button and one chart.
when i clicked one of the button it will set the dataTipRenderer of
the chart to a certain DataTip and when i will click the other button
it will set the dataTipRenderer to another DataTip class.

The problem is, it's not switching. :((
it always remains in the initial stage. :((

here is the code:

<?xml version="1.0"?>
<!-- charts/CustomDataTipRenderer.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
creationComplete="applyCustomDataTips()">
  <mx:Script><![CDATA[
        import mx.charts.chartClasses.DataTip;
        import mx.skins.halo.ToolTipBorder;
        import mx.skins.Border;
        import mx.skins.RectangularBorder;
        import mx.skins.ProgrammaticSkin;
     import mx.collections.ArrayCollection;

     [Bindable]
     public var expenses:ArrayCollection = new ArrayCollection([
        {Month:"Jan", Profit:2000, Expenses:1500},
        {Month:"Feb", Profit:1000, Expenses:200},
        {Month:"Mar", Profit:1500, Expenses:500}
     ]);
    private function applyCustomDataTips():void {
       // myChart.setStyle
("dataTipRenderer",mx.skins.ProgrammaticSkin);

    }

    private function toolTipOn():void
    {
        myChart.setStyle("dataTipRenderer",DataTip);
    }

    private function toolTipOff():void
    {
        myChart.setStyle("dataTipRenderer",mx.skins.ProgrammaticSkin);
    }

  ]]></mx:Script>

  <mx:HBox width="100%" height="10%">
  <mx:Button label="Tool Tip On" click="toolTipOn()"/>
  <mx:Button label="Tool Tip Off" click="toolTipOff()"/>
  </mx:HBox>
  <mx:Panel title="Bar Chart">
     <mx:BarChart id="myChart"
        dataProvider="{expenses}"
        showDataTips="true"
     >
        <mx:verticalAxis>
           <mx:CategoryAxis
                dataProvider="{expenses}"
                categoryField="Month"
           />
        </mx:verticalAxis>
        <mx:series>
           <mx:BarSeries
                    id="bar1"
                yField="Month"
                xField="Profit"
                displayName="Profit"
           />
           <mx:BarSeries
                        id="bar2"
                yField="Month"
                xField="Expenses"
                displayName="Expenses"
           />
        </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
  </mx:Panel>
</mx:Application>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to