I was wondering if Arcade allows you to add color to a part of your label. Here is what I am trying to show in my label:
Solved! Go to Solution.
I notice that you are labeling polygons. When labeling polygons you don't have the option to define the labels. You could extract the label points from the polygons and label the points instead. This could be achieved using Feature To Point—Data Management toolbox | ArcGIS Desktop (which requires an advanced license). It you don't have an Advanced license level, I can share a script that allows to create the label points using a Basic license.
The disadvantage will be that if you are zoomed in and the label point is outside the visible extent, there will be no label for that polygon visible.
The help (Create labels—ArcGIS Online Help | ArcGIS ) states completely at the end that the "Map Viewer does not support multiline labeling". There is an idea here: More options/controls on labeling features on webmaps, such as scale dependency and stacking that asks for stacked labels and was marked as implemented, but was only partially implemented.
Maybe KGerrow-esristaff can tell us a little more if this is on the roadmap. .
Sure you can:
See the help: Text formatting tags—ArcGIS Pro | ArcGIS Desktop
The formula that I applied was:
Round($feature.Total/1000,1) + 'M' + TextFormatting.NewLine + '<CLR red = "255">(' + Round($feature.Mean/10,0) + 'k)</CLR>'
Please note that my field names and data ranges differ.
Thank you so much for your quick response.
Your fomula works great in ArcPro, but when I use it in ArcGIS online to
host a map that I am using in a story map, it does not work. Here is how it
looks:
It seems like AOL does not stack labels, nor show the different colors. Is
that the case? Any advice?
Thank you!
Apparently color tags and multiline labels are not supported (yet) in ArcGIS Online. Let me test something and I get back to you.
The only thing I can think of for the moment is to load the layer twice and define the red and black labels separately:
In this case using the middle right position for the red label and the top right position for the black label. Color can be defined in the create label interface.
Each layer should have its own expression:
and
Two layer in the map:
Your images show exactly what I want to do! This is a great idea, but where
do you get the alignment commands (alineacion) that you show in your
pictures? If you go to ArcGIS online, the only option I see after "text"
and "halo" is the "visibility range". Am I missing something?
Thank you again for taking the time to help!
I notice that you are labeling polygons. When labeling polygons you don't have the option to define the labels. You could extract the label points from the polygons and label the points instead. This could be achieved using Feature To Point—Data Management toolbox | ArcGIS Desktop (which requires an advanced license). It you don't have an Advanced license level, I can share a script that allows to create the label points using a Basic license.
The disadvantage will be that if you are zoomed in and the label point is outside the visible extent, there will be no label for that polygon visible.
The help (Create labels—ArcGIS Online Help | ArcGIS ) states completely at the end that the "Map Viewer does not support multiline labeling". There is an idea here: More options/controls on labeling features on webmaps, such as scale dependency and stacking that asks for stacked labels and was marked as implemented, but was only partially implemented.
Maybe KGerrow-esristaff can tell us a little more if this is on the roadmap. .
Hi,
This functionality will be added as part of the Map Viewer re-design project. Currently, stacking labels is not supported in the 3X JavaScript API, but will be in the 4x API. This is on the roadmap but will still be quite a few releases away.
-Kelly
Thank you so much Xander, that is a brilliant idea!!
You're welcome and as Kellymentioned, it is on the roadmap, but it will take a while.
Just remember that if you have large polygons and only generate a single label point for each polygon, you will not see many labels when zoomed in.
It this answered the question, could you mark the post that answered your question as the correct answer?
Thanks in advance.