Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 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

DxChartConstantLineLabel.VerticalAlignment Property

Aligns constant line labels vertically.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public VerticalAlignment? VerticalAlignment { get; set; }

#Property Value

Type Description
Nullable<VerticalAlignment>

An enumeration value.

Available values:

Name Description
Top

Aligns the items or text at the top.

Center

Aligns the items or text at the center.

Bottom

Aligns the items or text at the bottom.

#Remarks

Use HorizontalAlignment and VerticalAlignment properties to align constant line labels horizontally and vertically. The table below demonstrates how alignment properties apply to constant line labels based on the axis type.

Axis HorizontalAlignment VerticalAlignment
Value Axis blazor-chart-value-cs-line-horalignment blazor-chart-value-cs-line-veralignment
Argument Axis blazor-chart-arg-cs-line-horalignment blazor-chart-arg-cs-line-veralignment
Razor
<DxChart Data="@WeatherForecasts">
    <DxChartTitle Text="Annual Weather in New York" />
    <DxChartLineSeries SummaryMethod="@(i => i.Average())"
                       Color="@Color.Gray"
                       ValueField="@((DetailedWeatherSummary i) => i.AverageTemperatureF)"
                       ArgumentField="@(i => new DateTime(2000, i.Date.Month, 1))"
                       Name="Temperature, °F"
                       Filter="@((DetailedWeatherSummary i) => i.City == "NEW YORK")" />
    <DxChartLegend Visible="false" />
    <DxChartValueAxis>
        <DxChartAxisTitle Text="Temperature, °F" />
        <DxChartConstantLine Value="55">
            <DxChartConstantLineLabel HorizontalAlignment="HorizontalAlignment.Right"
                                      Text="55, °F" />
        </DxChartConstantLine>
    </DxChartValueAxis>
    <DxChartArgumentAxis>
        <DxChartAxisLabel Format="ChartElementFormat.Month" />
        <DxChartConstantLine Value="@(new DateTime(2000, 6, 1))">
            <DxChartConstantLineLabel VerticalAlignment="VerticalAlignment.Center"
                                      Text="June, 2000"/>
        </DxChartConstantLine>
    </DxChartArgumentAxis>
</DxChart>

DxChart - Constant Line Label Alignment

See Also