arcgis online color labels

755
2
08-19-2019 01:05 PM
BobSteiss
New Contributor III

I would like to label the point features on my arcgis online web map with the text values from 2 fields but I'd like the text values to be different colours.  Can this be done using an arcade expression in ArcGIS Online?  

0 Kudos
2 Replies
TylerBurns
New Contributor III

Hello Bob,

It is indeed possible to specify color when creating a label class with an Arcade expression in Javascript API. The color is specified within the 'symbol' parameters of a a label class constructed with an Arcade label expression. The below article delves into how to create a label expression using Arcade: 

Labeling-- Arcade ArcGIS API for Javascript:

https://developers.arcgis.com/javascript/latest/guide/arcade/#labeling

I unfortunately do not believe it is possible to have two different colors displayed in the same label class however. Labels have not been designed with multicolor symbology in mind as an available functionality at this time. 

An alternative workflow to consider may be to create two seperate label classes using the two fields and colors that you want, and then just switch the active label class on the layer when you want to see the other labels/colors from the other field.

I hope this information is helpful!

-TB

BobSteiss
New Contributor III

Yes, that is very helpful.  Thanks.

0 Kudos