Skip to main content
All docs
V24.2

LegendBaseSettings<TComponent, TModel>.HorizontalAlignment Property

Specifies horizontal legend alignment.

Namespace: DevExpress.Blazor.Base

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(HorizontalAlignment.Right)]
[Parameter]
public HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

Type Default Description
HorizontalAlignment Right

An enumeration value.

Available values:

Name Description
Center

Center alignment.

Left

Left alignment.

Right

Right alignment.

Remarks

Specify the HorizontalAlignment property to align the legend horizontally.

Example

The following code snippet positions the DxBarGauge legend at the right component border:

<DxBarGauge Width="30%"
            Height="500px"
            StartValue="0"
            EndValue="100"
            Values="@Values">
    <DxBarGaugeLegendSettings Visible="true"
                              ItemCaptions="@LegendItemCaptions"
                              BackgroundColor="lightgrey"
                              HorizontalAlignment="HorizontalAlignment.Right" />
    @* ... *@
</DxBarGauge>

@code {
    double[] Values = new double[] { 47.27, 65.32, 84.59, 81.86, 99 };
    string[] LegendItemCaptions = new string[] { "Metacritic", "Ratingraph.com", "Rotten Tomatoes", "IMDb", "TV.com" };
}
See Also