Skip to main content
All docs
V25.1
  • DevExpress v25.1 Update — Your Feedback Matters

    Our What's New in v25.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

    Take the survey Not interested

    LegendBaseSettings<TComponent, TModel>.HorizontalAlignment Property

    Specifies horizontal legend alignment.

    Namespace: DevExpress.Blazor.Base

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    #Declaration

    C#
    [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:

    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