This documentation is archived and is not being maintained.

Legend.LegendStyle Property

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

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.