Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Sets or returns how the legend will be positioned in relation to the chart's plot area.

Signature
C#
C#
<table class="diff-macro"><thead><tr><th class="diff-macro-title">unmigrated-wiki-markup</th></tr></thead><tbody><tr><td class="diff-macro-body"><pre>
 public LegendLocation Location{ get; set; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
<p>Public Property Location() As LegendLocation</p>
Remarks

If you manually set any of the ChartRegion properties Height, Width, X, or Y, the Location will be set to NotDocked.

If you manually set Location to be a LegendLocation other than LegendLocation.NotDocked, the legend will be docked and Excel will position the legend accordingly. There are subtle differences in how Excel displays the legend, especially when expanding or shrinking the chart, so the X, Y, Width, and Height properties do not have meaning for a docked legend.

The Vertical property does not correspond to a specific feature in Excel. It approximates new width and height values so that the legend entries are stacked vertically or horizontally.