1 Reply Latest reply on Dec 1, 2009 9:25 PM by mrseanpaul81

    Help with Datatip Not showing on 2 different charts at the same time

    mrseanpaul81

      What's up guys?  I am building a massive application and came across an issue. I was able to create a smaller flex application that recreate the problem. Basically its about the datatip. Let's say you have a Main application with tab navigation that calls 2 different modules:  Module A, and Module B. Module A has a piechart with datatip enabled. Module B has a linechart with datatip also enabled. For some reason the piechart datatip are showing while the linechart datatip are not showing on mouse over (only on click). Any idea what's going on or how to fix it so that both charts show their datatip on mouse over? -Thank you

       

      Here are the codes below:

       

      MAIN APPLICATION:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" paddingTop="20">
          <mx:VBox paddingTop="50" width="80%" height="100%" paddingLeft="50">       
                  <mx:TabNavigator width="80%" height="100%" >           
                      <mx:VBox label="Module A" >
                          <mx:ModuleLoader url="tester2.swf" width="100%" height="100%"/>
                      </mx:VBox>
                      <mx:VBox label="Module B" mouseChildren="true" >
                          <mx:ModuleLoader url="tester.swf" width="100%" height="100%" />
                      </mx:VBox>                   
                  </mx:TabNavigator>   
          </mx:VBox>   
      </mx:Application>

       

       

      Module A:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"   xmlns:local="assets.*"  initialize="_onInitialize( event )">
          <mx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import mx.events.FlexEvent;
                  import mx.collections.ArrayCollection;
                 
                  [Bindable] private var _chartDP:ArrayCollection;
                 
                  private function mouser(event:MouseEvent):void
                  {
                      Alert.show("RPG");
                  }
                 
                  private function  _onInitialize( event:FlexEvent ):void
                  {
                      // set up our chart data
                      _chartDP = new ArrayCollection();
                      _chartDP.addItem( { quarter:1, shooter:1000, racing:400, rpg:550 } );
                      _chartDP.addItem( { quarter:2, shooter:875, racing:230, rpg:600 } );
                      _chartDP.addItem( { quarter:3, shooter:920, racing:310, rpg:512 } );
                      _chartDP.addItem( { quarter:4, shooter:750, racing:130, rpg:489 } );
                  }
              ]]>
          </mx:Script>
         
          <!-- defining the chart -->
          <mx:LineChart id="gameSales_chrt"   
             dataProvider="{ _chartDP }" showDataTips="true"  y="45" x="83" >
              <!-- Setting our Axis/Axes -->
              <mx:horizontalAxis>
                  <mx:CategoryAxis categoryField="quarter" title="Sales Quarter" />
              </mx:horizontalAxis>   
              <!-- Set up our data series -->   
              <mx:series >
                  <mx:LineSeries yField="shooter" displayName="First Person Shooter" form="segment" />
                  <mx:LineSeries yField="racing" displayName="Racing Simulation" form="segment" />
                  <mx:LineSeries yField="rpg" displayName="Role Playing Game" form="segment"  />
              </mx:series>
          </mx:LineChart>
          <!-- Set up the legend for the chart -->
          <mx:Legend dataProvider="{ gameSales_chrt }" direction="horizontal"  x="121" y="10"/>
      </mx:Module>

       

      Module B:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  initialize="_onInitialize( event )">
          <mx:Script>
              <![CDATA[
                  import mx.events.FlexEvent;
                  import mx.collections.ArrayCollection;
                 
                  [Bindable] private var _chartDP:ArrayCollection;
                 
                  private function  _onInitialize( event:FlexEvent ):void
                  {
                      // set up our chart data
                      _chartDP = new ArrayCollection();
                      _chartDP.addItem( { genre:"Shooter", quarter1:1000, quarter2:932,  quarter3:845, quarter4:663 } );
                      _chartDP.addItem( { genre:"Racing",  quarter1:565,  quarter2:875,  quarter3:732, quarter4:432 } );
                      _chartDP.addItem( { genre:"RPG",     quarter1:432,  quarter2:743,  quarter3:531, quarter4:289 } );
                  }
              ]]>
          </mx:Script>
         
          <!-- defining the chart -->
          <mx:PieChart id="gameSales_chrt"   
             dataProvider="{ _chartDP }"
             showDataTips="true" y="60" x="10">
              <!-- Set up our data series -->   
              <mx:series>
                  <mx:PieSeries
                      nameField="genre"
                      field="quarter2"
                      labelPosition="insideWithCallout" />
              </mx:series>
          </mx:PieChart>
          <!-- Set up the legend for the chart -->
          <mx:Legend dataProvider="{ gameSales_chrt }" direction="horizontal"  y="10" x="24"/>
      </mx:Module>

        • 1. Re: Help with Datatip Not showing on 2 different charts at the same time
          mrseanpaul81 Level 1

          Well upon using the debug function and having a stop at the show datatip static function, i came across this error

           

           

          TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::DragManagerImpl@195b9b21 to mx.managers.IDragManager.

          at mx.managers::DragManager$/get impl()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:15 2]

          at mx.managers::DragManager$/get isDragging()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager .as:187]

          at mx.charts.chartClasses::ChartBase/processRollEvents()[C:\work\flex\dmv_automation\project s\datavisualisation\src\mx\charts\chartClasses\ChartBase.as:2310]

          at mx.charts.chartClasses::ChartBase/mouseMoveHandler()[C:\work\flex\dmv_automation\projects \datavisualisation\src\mx\charts\chartClasses\ChartBase.as:4308]