Legend.Alignment Property

.NET Framework (current version)

Gets or sets the alignment of the legend.

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

public StringAlignment Alignment { get; set; }

Property Value

Type: System.Drawing.StringAlignment

A .NET Framework StringAlignment enumeration value that represents the alignment of the legend. The default value is Near.

The legend can be aligned so that it is Near, Center or Far; its alignment is also affected by the Docking property setting.

If the legend is docked to the top or bottom, Near is to the left; if it is docked to the left or right, Near is at the top. The Far property setting is just the opposite, and aligns the legend to the right or the bottom, depending on where it is docked.

Center always centers the legend, either vertically or horizontally.

Setting the Alignment property will have no effect if the Position property is not set to Auto.

.NET Framework
Available since 4.0
Return to top