PieChart for ASP.NET Web Forms
Legend
Pie Chart Elements > Legend

The legend element displays information about each data series of the chart. The chart legend displays the mapping between the physical colors and the data series.

C1PieChart automatically generates a Legend whenever data exists in the chart and if the LegendEntry property is enabled. The name of each series is represented in the legend when the Label property is specified. If there is no value specified in the Label property then the series names appear as undefined in the legend.

The legend is controlled by the Legend property, which returns a ChartLegend object with the following main properties:

Property Description
Text Contains text displayed in the legend title.
Compass Determines the position of the legend.
Visible Determines whether the legend is visible.
Orientation Determines whether the legend items should be displayed in the horizontal or vertical direction.

C1Chart sizes and positions the legend automatically, based on its contents and the Compass and Orientation properties.

The legend's orientation can be horizontal or vertical through its Orientation property and its position can be north, south, east, or west through its Compass property.

The following image shows the Compass set to South and the Orientation set to Horizontal.

See Also