Thematic Map Widget not working?

691
4
08-21-2012 07:39 AM
FranciscoCaldeira
New Contributor
It looks like the thematic Map widget is not working in Arcgis Flex version 3.0. When I click on a feature I should be able to see a infowindow insteed of this error message.

http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-thematic.xml


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts.chartClasses::ChartBase/initStyles()
at mx.charts.chartClasses::ChartBase/set moduleFactory()
at mx.charts.chartClasses::CartesianChart/set moduleFactory()
at mx.charts::ColumnChart/set moduleFactory()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()
at mx.core::Container/addChildAt()
at mx.core::Container/addChild()
at mx.core::Container/createComponentFromDescriptor()
at mx.core::Container/createComponentsFromDescriptors()
at mx.core::Container/createChildren()
at mx.core::UIComponent/initialize()
at mx.core::Container/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::UIComponent/addChildAt()
at spark.components::Group/addDisplayObjectToDisplayList()
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()
at spark.components::Group/setMXMLContent()
at spark.components::Group/createChildren()
at mx.core::UIComponent/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::Container/addChildAt()
at mx.core::Container/addChild()
at mx.core::Container/createComponentFromDescriptor()
at mx.core::Container/createComponentsFromDescriptors()
at mx.core::Container/createChildren()
at mx.core::UIComponent/initialize()
at mx.core::Container/initialize()
at widgets.Samples.ThematicQuery::InfoColumnChartWidget/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()
at mx.core::UIComponent/addChildAt()
at spark.components::Group/addDisplayObjectToDisplayList()
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()
at spark.components::Group/addElementAt()
at spark.components::Group/addElement()
at com.esri.ags.components.supportClasses::InfoWindow/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()

I'm using this Widget in a custom aplication but I'm experiencing the same problem. Is it just me or anyone noticed the same problem?

Kind regards
Francisco Caldeira
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Francisco,

  You are not the only one seeing this. Maybe the viewer team will see this and get it fixed for the next release.
0 Kudos
MehulChoksey
Esri Contributor
Thanks for reporting this. Following workaround (for flex sdk 4.6 regression) will be added in the next release of the viewer..

Add to InfoColumnChartWidget.mxml following funtions:
private function basewidget_preinitializeHandler(event:FlexEvent):void
            {
                // work-around for 4.6 regression
                copyStyleFromParent("mx.charts.chartClasses.ChartBase");
                copyStyleFromParent("mx.charts.chartClasses.CartesianChart");
                copyStyleFromParent("mx.charts.chartClasses.PolarChart");
                copyStyleFromParent("mx.charts.BarChart");
                copyStyleFromParent("mx.charts.ColumnChart");
                copyStyleFromParent("mx.charts.LineChart");
                copyStyleFromParent("mx.charts.PieChart");
                copyStyleFromParent("mx.charts.AxisRenderer");
                copyStyleFromParent(".blockCategoryAxis");
                copyStyleFromParent(".blockNumericAxis");
                copyStyleFromParent(".linedNumericAxis");
                copyStyleFromParent(".dashedNumericAxis");
                copyStyleFromParent(".dashedCategoryAxis");
                copyStyleFromParent(".hangingCategoryAxis");
                copyStyleFromParent("mx.charts.GridLines");
                copyStyleFromParent(".horizontalGridLines");
                copyStyleFromParent("mx.charts.series.BarSeries");
                copyStyleFromParent("mx.charts.series.ColumnSeries");
                copyStyleFromParent("mx.charts.series.LineSeries");
                copyStyleFromParent("mx.charts.series.PieSeries");
            }
            
            private function copyStyleFromParent(selector:String):void
            {
                var chartBaseStyle:CSSStyleDeclaration = styleManager.getStyleDeclaration(selector);
                if (!chartBaseStyle && styleManager.parent)
                {
                    var parentStyle:CSSStyleDeclaration = styleManager.parent.getStyleDeclaration(selector);
                    if (parentStyle)
                    {
                        styleManager.setStyleDeclaration(selector, parentStyle, false);
                    }
                }
            }


and update following:

<viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:viewer="com.esri.viewer.*"
                   creationComplete="init()"
                   preinitialize="basewidget_preinitializeHandler(event)"
                   implements="com.esri.viewer.IInfowindowTemplate">

0 Kudos
MehrshadNourani
New Contributor III
Hello,

Is there a new release available for Thematic Map Widget?
Thanks,
Mehrshad
0 Kudos
BjornSvensson
Esri Regular Contributor
Is there a new release available for Thematic Map Widget?


It is still available as a sample:
https://github.com/Esri/arcgis-viewer-flex/tree/master/src/widgets/Samples/ThematicQuery
0 Kudos