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.

AddAdditionalLegend

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

LegendDocking

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

LegendAlignment

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.

LegendAssigning

As a result, the additional legend will be displayed.

AdditionalLegend

Note

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.