ComponentOne BarChart for ASP.NET WebForms
Bar Chart Elements / Legend
In This Topic
    In This Topic

    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.

    C1BarChart 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.
    Style Contains properties that set the font, orientation, colors, and border of the legend.
    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.

    See Also