# Defining the Legend Element

## Content



The following graphic illustrates the Legend element in **C1Chart**:

<br />

![](https://cdn.mescius.io/document-site-files/images/70bd33a2-280e-4cc3-a1c0-7b827eceb8aa/imagesext/definelegendelement.png)

<br />

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. The legend is controlled by the [Legend](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.html) property, which returns a Legend object with the following main properties:

<br />

| **Property** | **Description** |
| --- | --- |
| [Text](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Text.html) | Contains text displayed in the legend title. |
| [Style](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Style.html) | Contains properties that set the font, orientation, colors, and border of the legend. |
| [Compass](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Compass.html) | Determines the position of the legend. |
| [Visible](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Visible.html) | Determines whether the legend is visible. |
| [Orientation](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Orientation.html) | Determines whether the legend items should be displayed in the horizontal or vertical direction. |
| [Reversed](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Reversed.html) | Controls the order that the ChartGroups appear in the legend. The order in which items of a ChartGroup appear in the legend is controlled by the LegendReversed property of each ChartGroup. |

<br />

**C1Chart** sizes and positions the legend automatically, based on its contents and the [Compass](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Compass.html) and [Orientation](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.Orientation.html) properties. To customize the legend position, the [SizeDefault](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.SizeDefault.html) and [LocationDefault](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.LocationDefault.html) properties can be modified (negative values activate the automatic sizing and positioning).

Note that the [Legend](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.Legend.html) property does not control the text for each legend item. It is determined by the label attached to each series. For example, [Label](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartDataSeries.Label.html) contains the text and [LegendEntry](/componentone/api/win/online-chart2d/dotnet-framework-api/C1.Win.C1Chart.4.8/C1.Win.C1Chart.ChartDataSeries.LegendEntry.html) determines whether the series label should be displayed in the legend.

### Creating the legend element

The legend element can be created programmatically through its Legend object or they can be created at design time through the Chart's Properties window, **Chart Properties** designer, or by Chart's Smart Designer.

The simplest way of creating them is through the Chart's Smart Designer. For more information on creating a chart legend through the Chart's Smart Designer, see [Add a Chart Legend](/componentone/docs/win/online-chart2d/chartforwinformstask/creatingandformattin1/addachartlegend). For more information on positioning the chart legend programmatically see [Displaying both the Chart Legend and Chart Header](/componentone/docs/win/online-chart2d/chartforwinformstask/displayingboththecha).

## See Also

[Defining the ChartArea Objects](/componentone/docs/win/online-chart2d/chartfundamentals/definingthechartarea)