1.290 FAQ-1168 How to Align Symbols in Legend?

Last Update: 3/29/2023

The Legend object usually contains two columns— the left column with legend symbol (usually same width) and the right column with legend text. By default, the legend symbol widths are the same and aligned, and so, using the Alignment toolbar button or Mini Toolbar only affects the alignment on the legend text column only.

But, if after setting the legend to be center or right-aligned and you notice the legend symbol column isn't aligned, e.g.

Legend symbol not aligned.png

then, your legend object is not a "real" legend object. Please try the following steps:

  1. Alt+Double-click on the legend object and check the object Name on Programming tab in Text Object dialog. Make sure the name is Legend and click Apply button. This ensures your object has special Legend properties and is not just a normal Text object.
    Legend or text.png
  2. Then go to the Text tab and make sure the Align Columns checkbox is checked.
    Legend alignment.png
  3. If you want to keep the whole legend center aligned but the legend text right aligned, add cell anchor \^(r) before each legend text.
    Legend right alignment.png

\^() is used as cell anchor, which sets the alignment for the object following on its right. \^(l), \^(c), \^(r) are LEFT, CENTER, and RIGHT alignment, respectively.


In certain situations, a graph needs two legend objects and so a text object is created as a second legend. This second text object should not be renamed to 'Legend' since we don't support duplicate object names in a graph. Since this text object cannot be renamed 'Legend' and inherit its special properties, we must use the cell anchor notation. If this is the case, please try the following:

  1. Check Align Columns checkbox on Text tab of the Text Object dialog.
  2. For each row of legend symbol and legend text, add \^(l) before each legend symbol part to align legend symbols column.
    Legend symbol aligned.png
  3. Again add \^(r) before each legend text part to right align legend text part.
    Legend left right alignment.png

See Also: FAQ-829 How can I right-align legend text or arrange the graph legend horizontally?


Keywords:Legend, Alignment, left-aligned, legend symbol