HOW TO

Apply different colors for conditioned labeling in ArcGIS Pro

Last Published: August 14, 2023

Summary

In ArcGIS Pro, multiline labels with concatenated text (string) can be configured to display different colored text using the ArcGIS Arcade text formatting tags. In this article's example, the Schools_all layer contains information on education institutions in Portland such as names, types, and ZIP Codes of the school, as shown below.

The map in ArcGIS Pro

This article describes the steps to apply different colored text labels displaying the NAME, LEVEL, and ZIPCODE field values using the Labeling syntax <CLR></CLR>.

Procedure

  1. Start ArcGIS Pro and open the project.
  2. In the Contents pane, right-click the feature class and click Labeling Properties... to open the Label Class pane.
The Contents pane in ArcGIS Pro
  1. In the Label Class pane, click the Label expression The Label expression icon button and configure the following parameters.
    1. For Language, select Arcade.
    2. Specify the following script in the Expression section. Change <text1>, <fieldName1>, <firstLabel2>, <colorName>, <text2>, <fieldName2>, <colorName>, <text3>, and <fieldName3> to match the environment.
'<text1>' + $feature.<fieldName1> + Textformatting.NewLine + "<CLR <colorName> = '255'>" + '<text2>' + $feature.<fieldName2> + "</CLR>" + Textformatting.NewLine + "<CLR <colorName> = '255'>" + '<text3>' + $feature.<fieldName3> + "</CLR>"
The following code block is an example of the full working script.
'Name: ' + $feature.NAME + Textformatting.NewLine + "<CLR red = '255'>" + 'Type: ' + $feature.LEVEL + "</CLR>" + Textformatting.NewLine + "<CLR blue = '255'>" + 'ZIP Code: ' + $feature.ZIPCODE + "</CLR>"
  1. Click Verify to run a test of the expression. If the expression is valid, click Apply.
The Label Class pane in ArcGIS Pro

The map below displays the distribution of education institutions in Portland, labeled with their respective names, types, and ZIP Codes in different colored text.

The map in ArcGIS Pro

Article ID: 000030963

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

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