Skip to main content

Adding Legends

This document describes how a new additional legend can be added to a chart at design time.

To add a new legend to a chart at design time, select the chart. In the Properties window, locate the ChartControl.Legends property and click the ellipsis button. In the invoked editor, click Add.


Then, configure the legend properties. Dock it to the required pane or chart control using the Legend.DockTarget property…


… and position it using the LegendBase.AlignmentVertical and LegendBase.AlignmentHorizontal properties.


For more information about the legend layout, refer to the Legends Alignment and Layout document.

Then, assign the legend to a series, indicator, constant line or strip using the SeriesBase.Legend, Indicator.Legend, ConstantLine.Legend or Strip.Legend property respectively.


As a result, the additional legend will be displayed.



Please note that the additional legend will not be displayed at runtime until it is assigned to a series, indicator, constant line or strip. At design time an empty legend will be labeled by Empty Legend text.

To learn how to add additional legends at runtime, refer to the How to: Add an Additional Legend to a Chart example.