Skip to main content

DxChartConstantLine.Width Property

Specifies the constant line width.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[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 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