4 Replies Latest reply on Feb 5, 2013 4:24 PM by krishna.kmps

    chart item select problem

    ruoyang
      Hi all,

      I'm getting the following error when I make a bubblechart selectable

      TypeError: Error #1034: Type Coercion failed: cannot convert mx.charts.events::ChartItemEvent@41747c1 to mx.events.IndexChangedEvent.
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\ core\UIComponent.as:9051]
      at mx.charts.chartClasses::ChartBase/ http://www.adobe.com/2006/flex/mx/internal::selectItem()[C:\Work\flex\dmv_automation\proje cts\datavisualisa tion\src\mx\charts\chartClasses\ChartBase.as:2503]
      at mx.charts.chartClasses::ChartBase/processRollEvents()[C:\Work\flex\dmv_automation\project s\datavisualisa tion\src\mx\charts\chartClasses\ChartBase.as:2277]
      at mx.charts.chartClasses::ChartBase/mouseDownHandler()[C:\Work\flex\dmv_automation\projects \datavisualisa tion\src\mx\charts\chartClasses\ChartBase.as:4248]

      The only code I changed was

      adding in the following to the <mx:bubbleChart tag
      selectionMode="multiple"

      and making by bubbleseries selectable
      bs.selectable=true;

      Anyone have any idea why I'm getting this error!?

      Thanks,
        • 1. Re: chart item select problem
          matthew horn Level 3
          I was not able to repro this error with a simple example. Can you please post a complete example that reproduces this error?

          matt horn
          flex docs
          • 2. Re: chart item select problem
            ruoyang Level 1
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
            <mx:Script>
            <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.charts.events.*;

            // Hack to prevent propagation of the ChartItemEvent.CHANGE as it is in conflict with IndexChangedEvent.CHANGE


            private function handleChange(event:Event):void
            {
            }
            private function handleTabChange(event:Event):void {
            }



            [Bindable]
            private var medalsAC:ArrayCollection = new ArrayCollection( [
            { Country: "A", Gold: 35, Silver:39, Bronze: 29 },
            { Country: "B", Gold: 32, Silver:17, Bronze: 14 }]);
            ]]>
            </mx:Script>
            <mx:TabNavigator change="handleTabChange(event)" width="100%" height="100%">
            <mx:Canvas label="Tab 1" width="100%" height="100%">
            <mx:Panel title="Bar Chart" x="0" y="10">
            <mx:BarChart id="myBarChart"
            height="225"
            showDataTips="true"
            dataProvider="{medalsAC}"
            selectionMode="multiple"
            change="handleChange(event)"
            >
            <mx:verticalAxis>
            <mx:CategoryAxis categoryField="Country"/>
            </mx:verticalAxis>
            <mx:series>
            <mx:BarSeries id="barSeries1"
            yField="Country"
            xField="Gold"
            displayName="Gold"
            selectable="true"
            />
            </mx:series>
            </mx:BarChart>
            <mx:Legend dataProvider="{myBarChart}"/>
            </mx:Panel>
            </mx:Canvas>
            <mx:Canvas label="Tab 1" width="100%" height="100%" >
            <mx:Panel title="Bar Chart" x="0" y="10">
            <mx:BarChart id="myBarChart2"
            height="225"
            showDataTips="true"
            dataProvider="{medalsAC}"
            selectionMode="multiple"
            change="handleChange(event)"
            >
            <mx:verticalAxis>
            <mx:CategoryAxis categoryField="Country"/>
            </mx:verticalAxis>
            <mx:series>
            <mx:BarSeries id="barSeries2"
            yField="Country"
            xField="Gold"
            displayName="Gold"
            selectable="true"
            />
            </mx:series>
            </mx:BarChart>
            <mx:Legend dataProvider="{myBarChart}"/>
            </mx:Panel>
            </mx:Canvas>
            </mx:TabNavigator>
            </mx:Application>

            see this code, when you select data item, the problem arises
            • 3. Re: chart item select problem
              matthew horn Level 3
              Very interesting. I think this is a bug. Can you please file it here?

              http://bugs.adobe.com/jira

              matt horn
              flex docs
              • 4. Re: chart item select problem
                krishna.kmps

                I am also faceing the same issue. Is this proplem got solved?