HOW TO

Create fractions as labels using Arcade in ArcGIS Pro

Last Published: July 4, 2024

Summary

In ArcGIS Pro, labelling a feature class with fractions can be an efficient method to represent statistical analysis. For example, it can be used to determine the number of activated cellular towers over the total number of installed cellular towers in a town.

This article describes the workflow to create the fractions as labels using ArcGIS Arcade in ArcGIS Pro.

Procedure

  1. Open the ArcGIS Pro project, add the layer, and create a label expression. Refer to Steps 1 through 4 in ArcGIS Pro: Writing a label expression for instructions. Select Arcade for Language.
Note: 
In the Contents pane, on the List By Labeling tab, ensure the selected feature layer and feature class check boxes are checked to display the labels.
  1. Insert and configure the expression below in the Expression box. Replace <fieldName1> and <fieldName2> with the field names of the layer. In this example, ‘MIN' and 'MAX' are used.
var numerator = $feature.MIN;
var denominator = $feature.MAX; return `<align horizontal ='center'><UND>${numerator}</UND>${TextFormatting.NewLine}${denominator}</align>`
  1. Click the Verify button to validate the expression.
  2. Uncheck the Remove extra spaces check box.
  3. Click Apply to run the script.
Writing the label expression to generate fractions

The image below shows the fractions displayed as labels in ArcGIS Pro.

Fractions as labels are created

Article ID: 000030522

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

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