# Legends

Add legends in the chart to understand the plotted data. Learn how to customize legend format, style, and position using Spread for ASP.NET.

## Content

The legend contains identifiers for each of the data series. The legend area can contain legend items, a background, and borders. The legend area is positioned using a relative location (where (0,0) = the left upper corner of the chart and (1,1) = the right lower corner of the chart) and a relative alignment (where (0,0) = the left upper corner of the label area and (1,1) = the right lower corner of the label area).
See the following for more information on how to set properties for the legend:

* [LegendArea](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.LegendArea.html)
* [LegendAreaCollection](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.LegendAreaCollection.html)

## Using Code

Use the [Location](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.LegendArea.Location.html), [AlignmentX](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.LegendArea.AlignmentX.html), and [AlignmentY](/spreadnet/api/latest/online-asp/FarPoint.Web.Chart/FarPoint.Web.Chart.LegendArea.AlignmentY.html) properties in the legend area classes to set the legend.

## Example

The following example sets properties for the legend.

```csharp
LegendArea legend = new LegendArea();
legend.Location = new PointF(0.98f, 0.5f);
legend.AlignmentX = 1.0f;
legend.AlignmentY = 0.5f;
```

```vbnet
Dim legend As New FarPoint.Web.Chart.LegendArea()
legend.Location = New PointF(0.98F, 0.5F)
legend.AlignmentX = 1.0F
legend.AlignmentY = 0.5F
```

## Using the Chart Designer

1. Select the **Legend Area Collection** editor.
2. Set the properties as needed.
3. Select **Apply** and **OK** to close the Chart Designer.