# Legends

Learn how to optimize the legend area in your chart with the help of LegendAreaCollection example and set properties for the legend in C# and Visual Basic.

## Content

The legend contains identifiers for each of the series of the data. 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:

* [Legend](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.LegendArea.html)
* [LegendAreaCollection](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.LegendAreaCollection.html)

## Example

The following example sets properties for the legend.

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

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

## Using the Chart Designer

1. Run the **Chart Designer**.
2. Select the target **Legend Area** from the tree menu on the left.
3. Set the required properties in the property list on the right.
4. Click OK and exit **Chart Designer**.

> !type=note
> **Note:** For information on starting [Chart Designer](/spreadnet/docs/latest/online-win/overview/spwin-designerguide), refer to Chart Designer in the [SPREAD Designer Guide](/spreadnet/docs/latest/online-win/overview/spwin-designerguide/fpchart-chartdesigner).

## See Also

[Chart User Interface Elements](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-chart-uiparts)
[Chart Object Model](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-chart-objects)
[Chart Types and Views](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-chart-charttv)
[Plot Types](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-plottypes)
[Plot area](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-plotsseries)
[Labels](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-style-labels)
[Error Bars](/spreadnet/docs/latest/online-win/overview/spwin-devguide/fpchart-devguide/fpchart-chartsummary/fpchart-chart-errorbars)