Skip to main content

DxChartValueAxis.ZeroAlwaysVisible Property

Specifies whether the value axis should always display zero.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(null)]
[Parameter]
public bool? ZeroAlwaysVisible { get; set; }

Property Value

Type Default Description
Nullable<Boolean> null

true to always show zero; otherwise, false.

Remarks

The Chart’s DxChartValueAxis shows a zero value for area and bar series. For other series types, this behavior depends on the data source.

In the following code snippet, all series values are greater than 13, and the Chart uses 12 as the first value of the Y-axis.

The Line Series Does Not Show Zero (Default)

To display a zero regardless of the series type and values, set the ZeroAlwaysVisible property to true.

@using Chart.Data
@inject WeatherForecastService ForecastService

<DxChart Data="@ChartData">
    <DxChartLineSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                       ValueField="@((WeatherForecast i) => i.TemperatureC)"
                       Name="Temperature" />
    <DxChartValueAxis ZeroAlwaysVisible="true" />
</DxChart>

@code {
    WeatherForecast[] ChartData;

    protected override async Task OnInitializedAsync()
    {
        ChartData = await ForecastService.GetForecastAsync();
    }
}

Zero Is Visible on the Value Axis

See Also