Skip to main content
A newer version of this page is available. .

DxChartConstantLine Class

Specifies an axis constant line.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public class DxChartConstantLine :
    DxComplexSettingsComponent<DxChartConstantLine, ChartConstantLineModel>,
    IModelProvider<ChartConstantLineLabelModel>

Remarks

Use the DxChartConstantLine component to mark an individual axis value. To set the value, use the DxChartConstantLine.Value property. A constant line’s label initially displays this value. Use the DxChartConstantLineLabel.Text property to change label text.

If the constant line is outside the visible axis range, use the ExtendAxis property to extend the axis so that the constant line becomes visible.

You can add multiple constant lines for the chart’s argument and value axes.

<DxChart Data="@forecasts">
    <DxChartArgumentAxis>
        <DxChartConstantLine Value="@("2020-May-14")">
            <DxChartConstantLineLabel Text="Current Date"
                                      VerticalAlignment="VerticalAlignment.Center"
                                      Position="RelativePosition.Inside" />
        </DxChartConstantLine>
    </DxChartArgumentAxis>
    <DxChartValueAxis>
        <DxChartConstantLine Value="18">
            <DxChartConstantLineLabel Text="Average"
                                      HorizontalAlignment="HorizontalAlignment.Center"
                                      Position="RelativePosition.Inside" />
        </DxChartConstantLine>
        <DxChartConstantLine Value="25" />
    </DxChartValueAxis>
    @* ... *@
</DxChart>

Constant Line

Use the following properties to configure constant line appearance:

  • Color: Specifies the color of the constant line.
  • DashStyle: Specifies the dash style of the constant line.
  • DisplayBehindSeries: Specifies whether to display the constant line behind series.
  • Width: Specifies the constant line width.

Inheritance

Object
ComponentBase
DxSettingsComponent<DevExpress.Blazor.Internal.ChartConstantLineModel>
DxComplexSettingsComponent<DxChartConstantLine, DevExpress.Blazor.Internal.ChartConstantLineModel>
DxChartConstantLine
See Also