Back to Devexpress

LegendBaseSettings<TComponent, TModel>.HorizontalAlignment Property

blazor-devexpress-dot-blazor-dot-base-dot-legendbasesettings-2-73ee1cbc.md

latest1.9 KB
Original Source

LegendBaseSettings<TComponent, TModel>.HorizontalAlignment Property

Specifies horizontal legend alignment.

Namespace : DevExpress.Blazor.Base

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
HorizontalAlignmentRight

An enumeration value.

|

Available values:

NameDescription
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:

razor
<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

LegendBaseSettings<TComponent, TModel> Class

LegendBaseSettings<TComponent, TModel> Members

DevExpress.Blazor.Base Namespace