Empty data series causing exception with RadzenStackedColumnSeries

Using: Radzen Blazor v4.9.2

The RadzenStackedColumnSeries component throws an exception when the data series is empty. Using the same data for the RadzenLineSeries component, no exceptions are thrown.

Below are two snippets taken from the demo site.

To reproduce the exception, use the data in the @code {} block at the bottom of thread. I have provided three scenarios to illustrate the behavior.

<RadzenChart>
	<RadzenLineSeries Smooth="@smooth" Data="@revenue2019" CategoryProperty="Date" Title="2019" LineType="LineType.Dashed" ValueProperty="Revenue">
		<RadzenMarkers MarkerType="MarkerType.Square" />
		<RadzenSeriesDataLabels Visible="@showDataLabels" />
	</RadzenLineSeries>
	<RadzenLineSeries Smooth="@smooth" Data="@revenue2020" CategoryProperty="Date" Title="2020" ValueProperty="Revenue">
		<RadzenMarkers MarkerType="MarkerType.Circle" />
		<RadzenSeriesDataLabels Visible="@showDataLabels" />
	</RadzenLineSeries>
	<RadzenCategoryAxis Padding="20" Formatter="@FormatAsMonth" />
	<RadzenValueAxis Formatter="@FormatAsUSD">
		<RadzenGridLines Visible="true" />
		<RadzenAxisTitle Text="Revenue in USD" />
	</RadzenValueAxis>
</RadzenChart>
<RadzenChart>
	<RadzenStackedColumnSeries Data="@revenue2019" CategoryProperty="Date" Title="2020" LineType="LineType.Dashed" ValueProperty="Revenue" />
	<RadzenStackedColumnSeries Data="@revenue2020" CategoryProperty="Date" Title="2019" ValueProperty="Revenue" />
	<RadzenColumnOptions Radius="5" Width="20" />
	<RadzenCategoryAxis Padding="20" />
	<RadzenValueAxis Formatter="@FormatAsUSD" Min="0" Max="800000" Step="100000">
		<RadzenGridLines Visible="true" />
		<RadzenAxisTitle Text="Revenue in USD" />
	</RadzenValueAxis>
</RadzenChart>
@code {
    bool smooth = false;
    bool showDataLabels = false;

    string FormatAsMonth(object value)
    {
		return Convert.ToDateTime(value).ToString("MMM", CultureInfo.CreateSpecificCulture("en-US"));
    }
    string FormatAsUSD(object value)
    {
        return ((double)value).ToString("C0", CultureInfo.CreateSpecificCulture("en-US"));
    }
    string FormatAsPercent(object value)
    {
        return ((double)value).ToString("P0", CultureInfo.CreateSpecificCulture("en-US"));
    }

    class DataSeriesItem
    {
        public string Date { get; set; }
        public double Revenue { get; set; }
    }

    //// Scenario 1. Using this data series will cause an exception to be thrown.
    IEnumerable<DataSeriesItem> revenue2019 = new List<DataSeriesItem>();
    IEnumerable<DataSeriesItem> revenue2020 = new List<DataSeriesItem>();

    // Scenario 2.  Using this data series works because the data series is not empty.
    IEnumerable<DataSeriesItem> revenue2019 = new List<DataSeriesItem>() { new DataSeriesItem() { Date = "2019-01-01", Revenue = 0 } };
    IEnumerable<DataSeriesItem> revenue2020 = new List<DataSeriesItem>() { new DataSeriesItem() { Date = "2019-01-01", Revenue = 0 } };

    // Scenario 3.  Using this data series works because the data series is not empty.  Wanted 
	//              to provide an example using the demo data.
    DataSeriesItem[] revenue2019 = new DataSeriesItem[] {
        new DataSeriesItem
        {
            Date = ("2019-01-01"),
            Revenue = 234000
        }
    };

    DataSeriesItem[] revenue2020 = new DataSeriesItem[] {
        new DataSeriesItem
        {
            Date = ("2019-01-01"),
            Revenue = 334000
        }
    };
}

Exception Browser:

Hi @sromankiw,

Thanks for the heads up! We will fix that with the next release of Radzen.Blazor (next week).

@korchev The fix is working in the latest build. Thanks.