Select to view content in your preferred language

Allow users to enter custom pie chart labels (New Map Viewer)

524
1
08-02-2023 01:47 PM
Status: Open
SteveCole
Frequent Contributor

Normally, ESRI allows users to alter/customize legend item descriptions but I've discovered that the chart element in a pop up (new map viewer) will not- it takes the label from the field name specified when constructing the chart.

Normally, this would probably be fine but I ran into a situation where I had a series of Arcade fields for a layer (aggregating census data in different ways) and I had to give the Arcade calculation the same name in order for the label that appears when hovering over the chart to say what I want-

popupChartArcadeFieldName.jpg

In the screenshot above, expressions 10-13 provide a percentage number back for the popup but expressions 14-17 provide a total number count (which the pie chart uses as input). As the chart element is currently implemented, it draws on the Arcade expression name provided and there isn't a way to change this other than renaming the expression as I have done above.

This just invites confusion for people maintaining applications, even if documented.

1 Comment
LaurenBoyd

Hi @SteveCole -

This is where Arcade popup elements should come into play. In short, attribute expressions are for if you want to create a virtual field and don't duplicate a lot of logic. With your example above, there is duplicate logic for the same data so you should utilize Arcade elements to create your charts and potentially the text elements that hold the formatted percentages.

This blog shows an example on how you could create an Arcade pop-up element that returns a chart with the formatted field names: https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/summarize-and-explore-point-clusters... 

Here's a list of some blogs discussing the pop-up Arcade elements.