Hello Community,
I'm currently developing an ArcGIS Dashboard and encountering an issue with pie charts created using Arcade data expressions. Despite following various guidelines and attempting multiple solutions, the pie charts are not interactive with the map. Specifically:
Below is the current version of my Arcade data expression (sensitive information has been masked):
// Data expression for Service Provider Pie Chart var fs = FeatureSetByPortalItem( Portal('https://example-portal.com'), 'your-portal-item-id', // Replace with your actual Portal Item ID 0, // Layer ID ['Provider', 'Tons', 'State', 'ObjectId'], // Fields to include false // Do not include geometry ); // Group by categorized Provider and sum Tons var providerTons = GroupBy( fs, [ { name: 'Category', expression: ` CASE WHEN Provider IN ('Provider1', 'Provider2', 'Provider3', 'Provider4') THEN Provider WHEN ( Provider IN ('Provider5', 'Provider6', 'Provider7', 'Provider8', 'Provider9') OR (Provider = 'Provider10' AND State = 'StateX') ) THEN 'Group1' ELSE 'Others' END ` } ], [ { name: 'TotalTons', expression: 'Tons', statistic: 'SUM' } ] ); // Sort the results by TotalTons in descending order var sortedProviderTons = OrderBy(providerTons, 'TotalTons DESC'); // Return the sorted results return sortedProviderTons;
Any insights or suggestions would be greatly appreciated. Thank you in advance for your help!
ArcGIS Dashboards needs either a spatial or attribute relationship to set up actions between different data sources. You can view what type of relationship is supported for each element in the Configure actions for elements help section. Map Actions use a spatial relationship between layers, therefore your data expression would need to include geometry.
In a spatial relationship, the following occurs:
Configure actions for elements: Map Actions
Considerations for Using Actions
Hello Jen,
Thank you for your previous response. I've made the changes you suggested, but I'm still encountering issues with making my pie chart interactive with the map. Here's what I've done:
However, despite these changes, the pie chart still doesn't appear as an option in the Map Actions settings. I'm not seeing any way to make it interactive with the map.
Here's a masked version of my current data expression:
// Data expression for Service Provider Pie Chart var fs = FeatureSetByPortalItem( Portal('https://example-portal.com'), 'your-portal-item-id', // Replace with actual Portal Item ID 0, // Layer ID ['Provider', 'Tons', 'State'], // Fields to include true // Include geometry ); // Group by categorized Provider and sum Tons var providerTons = GroupBy( fs, [ { name: 'Category', expression: ` CASE WHEN Provider IN ('Provider1', 'Provider2', 'Provider3', 'Provider4') THEN Provider WHEN ( Provider IN ('Provider5', 'Provider6', 'Provider7', 'Provider8', 'Provider9') OR (Provider = 'Provider10' AND State = 'StateX') ) THEN 'Group1' ELSE 'Others' END ` } ], [ { name: 'TotalTons', expression: 'Tons', statistic: 'SUM' } ] ); // Sort the results by TotalTons in descending order var sortedProviderTons = OrderBy(providerTons, 'TotalTons DESC'); // Return the sorted results return sortedProviderTons;
Below is a screenshot of my current pie chart configuration:
Is there something I'm missing? Do you have any other suggestions for making this pie chart interactive with the map?
Thank you for your continued help with this issue.
Hi Jen, and to anyone else who might read this and my post below,
I’ve been thinking about the issue with the pie chart, and I believe the problem comes down to how I grouped the data. When I created the group, it wasn’t part of the original dataset, so it’s like I made a new layer of grouped values, which isn’t interacting with the map’s original feature layer.
I think that’s why I can’t get the pie chart to work, because I essentially created something “new,” and something not found in the map, if that makes sense…
If any future GIS person sees this and knows if I’m right or wrong, or if there’s something I’m missing, please let me know!
God be with you.