Legend.LegendStyle Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the style of the legend.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public LegendStyle LegendStyle { get; set; }

Property Value

Type: System.Web.UI.DataVisualization.Charting.LegendStyle

A LegendStyle enumeration value that determines the legend style. The default value is Table.

By default, the legend is displayed as a series of items in a table. You can specify whether to expand items in the table width-wise or height-wise by setting the TableStyle property. When the TableStyle property is set to Auto, the Chart control will determine whether to draw a wide table or a tall table, depending on the alignment and positioning of the chart. This may cause the legend to be drawn using multiple legend item columns.

There are three possible styles for a legend: Column, Row and Table. Refer to the table below for a summary of these styles:




Legend items are displayed in one column, with multiple rows. Most commonly used when the legend is docked to the left or right of the chart.


Legend items are displayed in one row, with multiple columns. Most commonly used when the legend is docked to the top or bottom of the chart.


Legend items are displayed using multiple columns and rows.

.NET Framework
Available since 4.0
Return to top