ActiveReports 8
Legends
Show AllShow All
Hide AllHide All

The Chart control automatically creates a legend item for each series added to a chart at design time and sets the Legend property for each series by default. However, the legend's Visible property must be set to True for getting it displayed with the chart. The text for legend caption is taken from the Name property on the series.

Note: Each Series displayed in the Legend must have a Name. If the Name property is not set, the Series does not show up in the Legend.

The following code demonstrates how to create a legend at run time, add it to the Legends collection of the Chart object and set the legend property of the series to the new legend, resulting in the legend shown above.

To write code in Visual Basic.NET

To write code in C#

See Also
Support Forum