Hidden data not applied on Pie chart when new dataset is added

Expected Behavior

When you add new dataset to an existing Pie chart and previously you hide a data by legend, the data at index (which should be hidden) shouldn’t appear into chart.

Current Behavior

Using the CHART.JS sample. hiding a data of pie chart and then adding new dataset, the new dataset does not reflect the legend. See picture:

legendbug

Possible Solution

Before updating a chart, check with the legend that the data will apply the legend.

Steps to Reproduce

Using the CHART.JS sample:

  1. hide a data of pie chart by legend
  2. click on “Add Dataset” button

Environment

  • Chart.js version: 2.9.3
  • Browser name and version: FF 70.0.1

Author: Fantashit

1 thought on “Hidden data not applied on Pie chart when new dataset is added

  1. Thanks. Ok, yeah, that looks very similar to the initial report. You update the graph on zoom and want any datasets previously hidden to stay hidden. I think the main difference is that your case is a line chart and so hiding/showing happens per-dataset and not per-data-point like with a pie chart

Comments are closed.