How to label with a leader to a symbol and label

5385
6
Jump to solution
12-21-2022 09:13 AM
Labels (1)
IanLadd
New Contributor III

I have over 10 points in a small area, I want to create a label that has a symbol and text component to it, and then have that offset from the real symbol via a leader line, using the Maplex engine to place it? 

Essentially I'm wondering how to offset text to the side of the symbol being used as the label? I want to achieve the below. Preferably without having to convert to graphics or annotation because I have over 600 of these and don't want to have to manually place them.

 

 

Screenshot 2022-12-21 100835.jpg

0 Kudos
1 Solution

Accepted Solutions
JesseWickizer
Esri Contributor

You can achieve this style with Composite Callout text symbols. Here's an example of how...

    1. Open the Label Class pane and click the Class tab, then the Label expression tab.
      JesseWickizer_1-1672182375631.png
    2. Edit the label expression to use PART text formatting tags to define the arrangement of your label. The middle part will contain the symbol, and the right part will contain the label. The x_offset pushes the name away from the symbol - adjust this as necessary to achieve the desired look.
      "<PART position='middle'></PART><PART position='right' x_offset='5'>" + $feature.Name + "</PART>"
    3. In the Label Class pane, click the Symbol tab and change the Callout style to Composite.
      JesseWickizer_0-1672182068072.png
    4. Expand the Background symbol menu and choose Format polygon symbol... 
    5. In the Structure tab, Add symbol layer and choose Marker layer. Do this for as many point symbols you need to construct the desired symbol. Delete the default Fill layer and Stroke layer.
      JesseWickizer_3-1672182585036.png
    6. Click the Layers tab and edit the point symbol marker(s) to the desired styles. For each marker, in the Marker Placement group, change Placement to At center.
      JesseWickizer_5-1672183205423.png

      Click Apply to save symbol settings.

    7. Adjust the leader settings such as Proportion of dart drawn as leader as desired (100% for a simple leader line).
    8. From the Leader line symbol menu, select Format line symbol... to add a circle to the end of the leader.
    9. In the Structure tab, Add symbol layer and choose Marker layer.
    10. Click the Layers tab and with the new Shape marker selected, change Placement to At extremities and Extremities to At end.
      JesseWickizer_6-1672183588673.png

      Click Apply once all leader line styles are configured.

    11. Adjust the left, right, top, & bottom margins to control the spacing around the symbol.
    12. From the Position tab, adjust the placement properties for the desired positions. In this case since you're labeling lines, change the Placement to Regular placement with Offset horizontal position.

 

Note that labels are not dynamically stacked if the label expression contains the composite callout part text formatting tag. You could still stack using scripting though.

Final map style:

JesseWickizer_7-1672184054299.png

View solution in original post

6 Replies
MarcelSt-Germain
Occasional Contributor III

It's already implemented an more powerful than arcmap version. Take some time to find where they move it. Like always, ESRI change the way it was done in arcmap from the background of an annotation to Callout in pro.

Here an exemple of the leader (Sorry I forgot to unselect)

leader.png

Here the data for it

leader data.png

Like you can see, when you define you symbol, in attribute you have all the element needed to do the job.

You can make it the way you want. Arrow or not, line or dash or.... sky is the limit.

0 Kudos
JesseWickizer
Esri Contributor

You can achieve this style with Composite Callout text symbols. Here's an example of how...

    1. Open the Label Class pane and click the Class tab, then the Label expression tab.
      JesseWickizer_1-1672182375631.png
    2. Edit the label expression to use PART text formatting tags to define the arrangement of your label. The middle part will contain the symbol, and the right part will contain the label. The x_offset pushes the name away from the symbol - adjust this as necessary to achieve the desired look.
      "<PART position='middle'></PART><PART position='right' x_offset='5'>" + $feature.Name + "</PART>"
    3. In the Label Class pane, click the Symbol tab and change the Callout style to Composite.
      JesseWickizer_0-1672182068072.png
    4. Expand the Background symbol menu and choose Format polygon symbol... 
    5. In the Structure tab, Add symbol layer and choose Marker layer. Do this for as many point symbols you need to construct the desired symbol. Delete the default Fill layer and Stroke layer.
      JesseWickizer_3-1672182585036.png
    6. Click the Layers tab and edit the point symbol marker(s) to the desired styles. For each marker, in the Marker Placement group, change Placement to At center.
      JesseWickizer_5-1672183205423.png

      Click Apply to save symbol settings.

    7. Adjust the leader settings such as Proportion of dart drawn as leader as desired (100% for a simple leader line).
    8. From the Leader line symbol menu, select Format line symbol... to add a circle to the end of the leader.
    9. In the Structure tab, Add symbol layer and choose Marker layer.
    10. Click the Layers tab and with the new Shape marker selected, change Placement to At extremities and Extremities to At end.
      JesseWickizer_6-1672183588673.png

      Click Apply once all leader line styles are configured.

    11. Adjust the left, right, top, & bottom margins to control the spacing around the symbol.
    12. From the Position tab, adjust the placement properties for the desired positions. In this case since you're labeling lines, change the Placement to Regular placement with Offset horizontal position.

 

Note that labels are not dynamically stacked if the label expression contains the composite callout part text formatting tag. You could still stack using scripting though.

Final map style:

JesseWickizer_7-1672184054299.png

IanLadd
New Contributor III

Jesse! Thank you so much! This is exactly what I needed. 

0 Kudos
LorinCrandall1
New Contributor III

It looks like there are 4 different coding languages you can use in the label properties > Class menu, which one are you using. Tried pasting your code in Arcade and it just interpreted it as label text, not functional code. 

0 Kudos
IanLadd_Tourmaline
New Contributor III

Hi Jesse, How would I add a background color to the text? Essentially I want to create this Screenshot 2024-03-11 121248.png

0 Kudos
JesseWickizer
Esri Contributor

That label expression uses Arcade scripting language.

If your data fields contain the '&' or '<' characters, you need to replace them in your label expression if using text formatting tags  or else they will render the whole expression as text instead of interpreting the formatting tags. Here's an example to replace them dynamically in the label expression using the Arcade replace function.

"<PART position='middle'></PART><PART position='right' x_offset='5'>" + replace($feature.Name, '&', '&amp;') + "</PART>"

 

0 Kudos