Radzen Bar Chart breaks when using Min="0" (value axis) and Data is empty

Hi there,

Here is the context :

Radzen Bar Chart
Radzen Value Axis with Min="0"
Empty dataset or not empty with values equals 0

I can reproduce on the demo (using the following code)

@using System.Globalization

<RadzenStack class="rz-p-0 rz-p-md-6 rz-p-lg-12">
    <RadzenCard Variant="Variant.Outlined">
        <RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" Gap="0.5rem" Wrap="FlexWrap.Wrap">
            <RadzenCheckBox @bind-Value="@showDataLabels" Name="dataLabels"></RadzenCheckBox>
            <RadzenLabel Text="Show Data Labels" Component="dataLabels" />
        </RadzenStack>
    </RadzenCard>
    <RadzenRow>
        <RadzenColumn Size="12" SizeLG="6">
            <h4>Auto-size bar series</h4>
            <RadzenChart SeriesClick=@OnSeriesClick style="height: 400px">
                <RadzenBarSeries Data="@revenue2023" CategoryProperty="Quarter" Title="2023" ValueProperty="Revenue">
                    <RadzenSeriesDataLabels Visible="@showDataLabels" />
                </RadzenBarSeries>
                <RadzenValueAxis Min="0" Formatter="@FormatAsUSD">
                    <RadzenGridLines Visible="true" />
                    <RadzenAxisTitle Text="Revenue in USD" />
                </RadzenValueAxis>
                <RadzenBarOptions Radius="5" />
            </RadzenChart>
        </RadzenColumn>
    </RadzenRow>
</RadzenStack>

<EventConsole @ref=@console />

@code {
    EventConsole console;
    bool showDataLabels = false;

    void OnSeriesClick(SeriesClickEventArgs args)
    {
        console.Log(args);
    }

    class DataItem
    {
        public string Quarter { get; set; }
        public double Revenue { get; set; }
    }

    string FormatAsUSD(object value)
    {
        return ((double)value).ToString("C0", CultureInfo.CreateSpecificCulture("en-US"));
    }

    DataItem[] revenue2023 = new DataItem[]{};
}

Have a nice day !

Hi @kevinyn,

Thanks for reporting this issue. We will address it with the next release.

It still crashes when the step is set and all values are 0.

    <RadzenChart SeriesClick="Clicked" Style="height:50vh">
    <RadzenLineSeries Smooth="true" Data="@_machineDataChartsModel?.Sunlight" Stroke="#008000" CategoryProperty="DateTimeStamp" Title="@Localizer[nameof(MachineDataChartsComponentResource.Sunlight)]" LineType="LineType.Solid" ValueProperty="Y">
        <RadzenMarkers Visible="true" MarkerType="MarkerType.None" />
        <RadzenSeriesDataLabels Visible="false"/>
		<RadzenSeriesAnnotation TItem="TimeChartPoint<uint>" Data="_machineDataChartsModel?.Sunlight.ElementAtOrDefault(_sunlightIndex)" OffsetY="-10" Text="@Localizer[nameof(MachineDataChartsComponentResource.Selected)]" Visible="_sunlightVisible" />
		<RadzenSeriesAnnotation TItem="TimeChartPoint<uint>" Data="_machineDataChartsModel?.Sunlight.ElementAtOrDefault(_sunlightIndex)" OffsetY="0" Text="x" Visible="_sunlightVisible" />
    </RadzenLineSeries>
    <RadzenCategoryAxis LabelAutoRotation="-45" FormatString="{0:HH:mm:ss}">
        <RadzenAxisTitle Text="@Localizer[nameof(MachineDataChartsComponentResource.Timestamp)]" />
        <RadzenGridLines Visible="true" />
    </RadzenCategoryAxis>
    <RadzenValueAxis Step="1">
        <RadzenGridLines Visible="true" />
        <RadzenAxisTitle Text="@Localizer[nameof(MachineDataChartsComponentResource.Sunlight)]" />
    </RadzenValueAxis>
    <RadzenLegend Position="LegendPosition.Bottom"/>
</RadzenChart>
System.ArithmeticException: Function does not accept floating point Not-a-Number values.
15:51:27:118	   at System.Math.Sign(Double value)
15:51:27:118	   at Radzen.Blazor.Rendering.SplineGenerator.CurveMonotone(IList`1 points)
15:51:27:118	   at Radzen.Blazor.Rendering.SplineGenerator.Path(IEnumerable`1 data)
15:51:27:118	   at Radzen.Blazor.RadzenLineSeries`1.<>c__DisplayClass26_0.<Render>b__1(RenderTreeBuilder __builder2)
15:51:27:118	   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
15:51:27:118	   at Radzen.Blazor.RadzenChart.<BuildRenderTree>b__116_2(RenderTreeBuilder __builder2)
15:51:27:118	   at Microsoft.AspNetCore.Components.CascadingValue`1.Render(RenderTreeBuilder builder)

When the step is removed the error goes away.