mariusmuntean / ChartJs.Blazor

Brings Chart.js charts to Blazor
https://www.iheartblazor.com/
MIT License
676 stars 151 forks source link

ArgumentOutOfRangeException when data is removed from sample charts #167

Closed mmuffins closed 3 years ago

mmuffins commented 3 years ago

When running the sample project, an exception is thrown if the 'Remove Data' button is clicked after all data points were already removed from a chart. This seems to affect all charts that have this functionality.

Which Blazor project type is your bug related to?

Which charts does this bug apply to?

All charts in the sample project that have the add/remove data functionality.

To Reproduce

Steps to reproduce the behavior:

  1. Build and run the current master version of the project
  2. Open the basic line chart (or any other chart that has a Remove Data button)
  3. Click the Remove Data button until all data has been removed from the chart
  4. Click the button once more
  5. An ArgumentOutOfRangeException is thrown

Expected behavior

No exception should occur

Joelius300 commented 3 years ago

Oh wow, that's embarrassing 😅

I specifically took care of this error for removing datasets because this was an issue with the last sample-version. But that made me miss the other one, oops.

mmuffins commented 3 years ago

Yeah, that happens. I pushed an update to #165 which should fix the samples. After the patch I wasn't able to crash any of the samples.