Skip to main content

DxChartConstantLineLabel.HorizontalAlignment Property

Aligns constant line labels horizontally.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Default Description
HorizontalAlignment Left

An enumeration value.

Available values:

Name Description
Center

Center alignment.

Left

Left alignment.

Right

Right alignment.

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