Exception when creating dashboard-chart

87
0
04-16-2021 05:36 AM
TorbjørnDalløkken2
New Contributor III

Hi. 

I'm trying to create a Dashboard using the arcgis.apps.dashboard library, and I've got a problem creating charts. I've succeeded in creating a empty chart and adding it to a new dashboard, but as soon as I try to add a valuefield I get an exception. The chart is using groupByValues, so I need to add a field using the function add_value_field(). I pass the fieldname through this function like this:

chart = SerialChart(item = webmap,
layer=0,
name="Test Chart",
title = "Test Title",
categories_from = "groupByValues")

chart.data.add_value_field("PriKlasse")

Then I get this exception:

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\apps\dashboard\_serialchart\_serial_chart.py in _field_type(self, field_name)
   1046 
   1047     def _field_type(self, field_name):
-> 1048         f_type = self._item.tables[0].query().sdf[field_name].dtype
   1049         return f_type
   1050 

IndexError: list index out of range

The error seems to be the same as described in this post: https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojs...

 

0 Kudos
0 Replies