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.Width Property

Specifies the constant line width.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(1)]
[Parameter]
public int Width { get; set; }

#Property Value

Type Default Description
Int32 1

The constant line width in pixels.

#Remarks

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

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