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

DxChartConstantLine.Color Property

Specifies the color of the constant line.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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 changes the color and width of the constant line:

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