<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating Dashboard elements with GeoJSON in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024505#M5524</link>
    <description>&lt;P&gt;Hello! So we have been using the ArcGIS Dashboard for some time and we are now making use of the recently added submodule arcgis.apps.dashboard.&lt;/P&gt;&lt;P&gt;One of the issuess we are facing is creating a dashboard elements(charts,gauge etc) with GeoJSON related data. When the Python API tries to create a Dashboard chart element, it usually looks after table data. But since we are dealing with GeoJSON, the data it is stored in propertie objects and not tables.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;File "D:\Anaconda\envs\agol_env\lib\site-packages\arcgis\apps\dashboard\_gauge\_gauge.py", line 507, in objectid_field

    return self._item.tables[0].properties["objectIdField"]

IndexError: list index out of range&lt;/LI-CODE&gt;&lt;P&gt;Creating dashboard elements with GeoJSON related object works fine manually on the ArcGIS Online website.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 18:25:22 GMT</pubDate>
    <dc:creator>Wirescan</dc:creator>
    <dc:date>2021-02-08T18:25:22Z</dc:date>
    <item>
      <title>Creating Dashboard elements with GeoJSON</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024505#M5524</link>
      <description>&lt;P&gt;Hello! So we have been using the ArcGIS Dashboard for some time and we are now making use of the recently added submodule arcgis.apps.dashboard.&lt;/P&gt;&lt;P&gt;One of the issuess we are facing is creating a dashboard elements(charts,gauge etc) with GeoJSON related data. When the Python API tries to create a Dashboard chart element, it usually looks after table data. But since we are dealing with GeoJSON, the data it is stored in propertie objects and not tables.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;File "D:\Anaconda\envs\agol_env\lib\site-packages\arcgis\apps\dashboard\_gauge\_gauge.py", line 507, in objectid_field

    return self._item.tables[0].properties["objectIdField"]

IndexError: list index out of range&lt;/LI-CODE&gt;&lt;P&gt;Creating dashboard elements with GeoJSON related object works fine manually on the ArcGIS Online website.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 18:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024505#M5524</guid>
      <dc:creator>Wirescan</dc:creator>
      <dc:date>2021-02-08T18:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dashboard elements with GeoJSON</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024766#M5527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/446573"&gt;@Wirescan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;No sure exactly what you're trying to achieve.&lt;/P&gt;&lt;P&gt;Is it possible to share your script?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 05:07:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024766#M5527</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-02-09T05:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dashboard elements with GeoJSON</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024796#M5528</link>
      <description>&lt;P&gt;All 3 elements are taking advantage of the same feature layer. The difference is that element 3 is requiring it through a webmap widget.&lt;/P&gt;&lt;P&gt;Here is the script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;### ITEMS
item_name= 'Faerder Cable Network As Found'
item_geojson_related = gis.content.search(query='title: "{0}"'.format(item_name), max_items=1, item_type='Feature Layer')[0]

webmap_name = 'Faerder Windmill Park Static View'
webmap_item = gis.content.search(query='title: "{0}"'.format(webmap_name), max_items=1, item_type='Web Map')[0]
webmap = WebMap(webmap_item)
### DASHBOARD ELEMENTS

# Element 1 - Cable Capacitance
capacitance_chart = SerialChart(item_geojson_related, name='Cable Capacitance', categories_from='features', description='Cable Capacitance')
capacitance_chart.data.category_field = 'CableID'
capacitance_chart.data.add_value_field('Measureed Capacitance (pF/m)')

# Element 2 - Cable Inductance
inductance_chart = SerialChart(item_geojson_related, name='Cable Inductance', categories_from='features', description='Cable Inductance')
inductance_chart.data.category_field = 'CableID'
inductance_chart.data.add_value_field('Measured Inductance (micro Henry/m)')


# Element 3 - Gauge
gauge = Gauge(webmap, name='Average Delta G in Visible Cable Network', layer=0, description='Average Delta G in Visible Cable Network')
gauge.data.value_type = 'statistic'
gauge.data.statistics = 'Average'
gauge.data.statistics_field = 'Delta_G'
gauge.gauge_options.shape = 'horseshoe'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Element 1&amp;amp;2 returns this error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;  File "C:/Users/Henrik/AppData/Roaming/JetBrains/PyCharmCE2020.2/scratches/scratch_4.py", line 23, in &amp;lt;module&amp;gt;
    capacitance_chart.data.category_field = 'CableID'
  File "D:\Anaconda\envs\agol_env\lib\site-packages\arcgis\apps\dashboard\_serialchart\_serial_chart.py", line 916, in category_field
    if self._field_type(value) == '&amp;lt;M8[ns]':
  File "D:\Anaconda\envs\agol_env\lib\site-packages\arcgis\apps\dashboard\_serialchart\_serial_chart.py", line 1048, in _field_type
    f_type = self._item.tables[0].query().sdf[field_name].dtype
IndexError: list index out of range&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 08:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1024796#M5528</guid>
      <dc:creator>Wirescan</dc:creator>
      <dc:date>2021-02-09T08:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dashboard elements with GeoJSON</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1136303#M7033</link>
      <description>&lt;P&gt;I also have the same issue like &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/446573"&gt;@Wirescan&lt;/a&gt;. When will this bug be fixed?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 09:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-dashboard-elements-with-geojson/m-p/1136303#M7033</guid>
      <dc:creator>PraktikantPraktikant</dc:creator>
      <dc:date>2022-01-24T09:08:53Z</dc:date>
    </item>
  </channel>
</rss>

