Back to Devexpress

DxChartConstantLine Class

blazor-devexpress-dot-blazor-65a854b3.md

latest4.7 KB
Original Source

DxChartConstantLine Class

Specifies an axis constant line.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Remarks

Use DxChartConstantLine objects to customize constant line settings in the following components:

DxChart<T>A control that visualizes bound data as graphs: bar, area, line, and others.DxPolarChart<T>A control that visualizes bound data as graphs in polar coordinates.

Use the DxChartConstantLine component to mark an individual axis value (Value). A constant line label initially displays this value. Use the Text property to change label text. Each axis can contain multiple constant lines.

If the created constant line is outside the visible axis range, use the ExtendAxis property to extend the axis and include the constant line into the visible axis range.

The following example creates two constant lines for the value axis and one line for the argument axis:

razor
<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.Left"
                                      Position="RelativePosition.Inside" />
        </DxChartConstantLine>
        <DxChartConstantLine Value="25" />
    </DxChartValueAxis>
    @* ... *@
</DxChart>

Use the following properties to configure a constant line’s position and appearance:

ColorSpecifies the color of the constant line.DashStyleSpecifies the dash style of the constant line.DisplayBehindSeriesSpecifies whether to display the constant line behind series.PaddingLeftRightSpecifies the padding between the left/right side of a constant line and its label.PaddingTopBottomSpecifies the padding between the top/bottom side of a constant line and its label.WidthSpecifies the constant line width.

Run Demo: Charts - Constant Lines

To customize font settings of a constant line label, use the DxChartFont object. Refer to Font Customization for additional information.

Refer to the following section for additional information about constant line customization: Constant Lines.

Implements

IComponent

IHandleEvent

IHandleAfterRender

IDisposable

Inheritance

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

See Also

DxChartConstantLine Members

DevExpress.Blazor Namespace