Select to view content in your preferred language

In the web map, how to match the label colors with the symbol colors

324
3
Jump to solution
07-16-2025 11:29 AM
SanchezNuñez
Frequent Contributor

Good afternoon,

In the web map, how to match the label colors with the symbol colors?

Thanks

 

1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Unfortunately you can't assign colors to a label using Arcade. Instead, you'll have to create label classes for each symbol. In this first class, I want to show the deep points with a red label

Snag_19229eb.png

Use the Filter to show only that attribute and set the Label style.

Snag_1967316.png

Here I've added another label class to show shallow points with a smaller green label.

Snag_193a530.png

This class uses a different filter

Snag_197a51d.png

View solution in original post

0 Kudos
3 Replies
CodyPatterson
MVP Regular Contributor

Hey @SanchezNuñez 

What you can do, is go to the symbology of the item you're wanting to match like this here:

Click the Color and hit done:

CodyPatterson_0-1752691382375.pngCodyPatterson_1-1752691409257.png

This will add the color to the selection wheel (I already clicked done on mine previously):

CodyPatterson_2-1752691472237.png

Go to the label, edit the label style, and choose the color from the wheel you had chosen before:

CodyPatterson_4-1752691556004.png

You can adjust the Halo, and background the same way.

Is this what you were asking?

Cody

 

 

0 Kudos
SanchezNuñez
Frequent Contributor

This line layer represents projects by phase: planning, design, procurement, constructions and closeout.  The request is to show the label in the same color as the line.

 

Asked Copilot and this is the answer:

var phase = $feature.ProjectPhase;
var color = "";
if (phase == "Planning") {
color = "blue";
} else if (phase == "Design") {
color = "purple";
} else if (phase == "Procurement") {
color = "orange";
} else if (phase == "Construction") {
color = "green";
} else if (phase == "Closeout") {
color = "gray";
}
return Text($feature.ProjectName, {"color": color});
 
 
0 Kudos
KenBuja
MVP Esteemed Contributor

Unfortunately you can't assign colors to a label using Arcade. Instead, you'll have to create label classes for each symbol. In this first class, I want to show the deep points with a red label

Snag_19229eb.png

Use the Filter to show only that attribute and set the Label style.

Snag_1967316.png

Here I've added another label class to show shallow points with a smaller green label.

Snag_193a530.png

This class uses a different filter

Snag_197a51d.png

0 Kudos