Select to view content in your preferred language

ArcGIS 2.5: How to set different color for labels using vbscript language?

6288
3
Jump to solution
04-25-2020 09:18 AM
JamalNUMAN
Legendary Contributor

ArcGIS 2.5: How to set different color for labels using vbscript language?

 

I couldn’t figure out how to set different color for labels using vbscript language shown in the screenshot below. How to set red, blue, green, yallow colors for name, area_A, Area_B, Area_C fields respectively?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus
3 Replies
DanPatterson_Retired
MVP Emeritus

Did you see the pages (multiple) on formatting

Text formatting tags—ArcGIS Pro | Documentation 

JamalNUMAN
Legendary Contributor

Many thanks Dan.

I managed to get different colors for the labels with the code below

"<BOL><CLR red='255' green='57' blue='42'>" & [Name_1] &  "</CLR></BOL>" &vbnewline& ("<BOL><CLR red='38' green='255' blue='42'>"& [Area_A]&"</CLR></BOL>" ) &vbnewline& ("<BOL><CLR red='21' green='46' blue='255'>"&[Area_B]&"</CLR></BOL>")  &vbnewline& ("<BOL><CLR red='255' green='24' blue='207'>" & [Area_C] &  "</CLR></BOL>")

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
JamalNUMAN
Legendary Contributor

I couldn’t figure out how to write the code that performs the following:

 

If the “retired by record” fields null, then the label is the “name” field

If the “retired by record” fields null is not null, then no labeling is required

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine