Skip to main content

DxChartConstantLine.Color Property

Specifies the color of the constant line.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Color Color { get; set; }

Property Value

Type Description
Color

The color.

Remarks

Use the Color property to specify the constant line color. You can also use the Width property to change the constant line thickness.

The following example shows how to change the color and width of the constant line:

@using System.Drawing

<DxChart Data="@SalesData">
    <DxChartValueAxis>
        <DxChartConstantLine Value="70000"
                             Color="Color.Orange"
                             Width="3">
            <DxChartConstantLineLabel HorizontalAlignment="HorizontalAlignment.Right" Text="Planned Amonut" />
        </DxChartConstantLine>
    </DxChartValueAxis>
    <DxChartLineSeries Name="2017"
                       Filter="@((SaleInfo s) => s.Date.Year == 2017)"
                       ArgumentField="@(s => s.City)"
                       ValueField="@(s => s.Amount)"
                       SummaryMethod="Enumerable.Sum" />
    <DxChartLineSeries Name="2018"
                       Filter="@((SaleInfo s) => s.Date.Year == 2018)"
                       ArgumentField="@(s => s.City)"
                       ValueField="@(s => s.Amount)"
                       SummaryMethod="Enumerable.Sum" />
    <DxChartLineSeries Name="2019"
                       Filter="@((SaleInfo s) => s.Date.Year == 2019)"
                       ArgumentField="@(s => s.City)"
                       ValueField="@(s => s.Amount)"
                       SummaryMethod="Enumerable.Sum" />
    <DxChartTitle Text="Sales Info" />
    <DxChartLegend Position="RelativePosition.Outside" HorizontalAlignment="HorizontalAlignment.Right" />
</DxChart>

Constant Line Color and Width

See Also