HOW TO

Create pop-up pie charts displaying the top three values in ArcGIS Pro

Last Published: January 29, 2024

Summary

In ArcGIS Pro, Arcade expressions can be used to display the top field values in a pop-up pie chart. This article provides an example and instructions using Arcade expressions to create a pop-up pie chart displaying the top three languages spoken at home in Caledon, Ontario, Canada.

Procedure

  1. Start ArcGIS Pro and open the project.
  2. In the Contents pane, right-click the feature class and click Configure Pop-ups to open the Configure Pop-ups pane of the feature class.
Opening the Configure Pop-ups tool of the feature class from the Contents pane
  1. In the Configure Pop-ups pane, click Expressions to add a field using an Arcade expression to use in the pop-up.
Note:
The following procedure (Steps 3 through 6) must be completed three times. One for each position of the top three values.
  1. In the Expressions pane, click New.
  2. In the Expression Builder dialog box, configure the following parameters for the Arcade expression.
    1. For Name, rename the new expression.
    2. For Title, specify a title for the new expression.
  3. For the Expression section, insert the following Arcade expression.
    1. To define the array of the target fields:
var <variableName1> = [
$feature.<fieldName1>,
$feature.<fieldName2>,
...
$feature.<fieldName214>
];
  1. To sort the array from the highest to the lowest and return the field value based on the defined index number, specify the expression below. The array index starts at 0.
  • For the top value, use the following script:
return Reverse(Sort(<variableName1>))[0]
  • For the second top value, use the following script:
return Reverse(Sort(<variableName1>))[1]
  • For the third top value, use the following script:
return Reverse(Sort(<variableName1>))[2]
The code block below shows the full working expression for the top value:
var lang_arr = [
$feature.MO_English,
$feature.MO_French,
$feature.MO_Hindi,
$feature.MO_Hungarian,
$feature.MO_Icelandic,
$feature.MO_Japanese,
$feature.MO_Korean,
$feature.MO_Krio,
$feature.MO_Ktunaxa_Kutenai,
$feature.MO_Malay,
$feature.MO_Malayalam,
$feature.MO_Mandarin,
$feature.MO_Mwani,
$feature.MO_Naskapi,
$feature.MO_Norwegian,
$feature.MO_Oneida,
$feature.MO_Oromo,
$feature.MO_Polish,
$feature.MO_Punjabi_Panjabi,
$feature.MO_Romanian,
$feature.MO_Rundi_Kirundi,
$feature.MO_Russian,
$feature.MO_Serbian,
$feature.MO_Serbo_Croatian,
$feature.MO_Sindhi,
$feature.MO_Spanish,
$feature.MO_Swedish,
$feature.MO_Tagalog_Pilipino_Filipino,
$feature.MO_Tamil,
$feature.MO_Turkish,
$feature.MO_Ukrainian,
$feature.MO_Urdu,
$feature.MO_Vietnamese,
$feature.MO_Wu_Shanghainese,
$feature.MO_Yiddish,
$feature.MO_Yoruba,
$feature.MO_Yue_Cantonese
];

return Reverse(Sort(lang_arr))[0]
  1. Click Verify to run a test of the expression. If the expression is valid, click OK.
The Expression Builder dialog box with an example of the Arcade expression
  1. In the Expressions pane, click Back The Back icon.
The Expressions pane
  1. Click Chart to add the chart pop-up element and click Edit pop-up element Edit Pop-up Element on the Chart element.
The Configure Pop-ups pane
  1. In the Chart Options pane, specify a title for the chart, check the three newly created expression check box in the Fields section, and click Back The Back icon to apply the pop-up chart configuration.
The Chart Options pane

The newly configured pop-up pie chart below shows the top three languages spoken at home in Caledon, Ontario, Canada.

The newly configured pop-up pie chart in ArcGIS Pro

Article ID: 000031731

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • ArcGIS Pro 3 2

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options