Replacing data on a bar chart that previusly had 1 data set item, with new data that has 2+ dataset items, the legend should appear and show the data.
Actual Behaviour
Replacing the datasets with 2+ items on a bar chart that only has 1 current dataset item will throw an error in the console and fail to render the chart:
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'textContent')
This is likely caused by the fact that a single dataset item bar chart does not create a legend. When replacing the data with something that now needs a legend, the code assumes one is present and attempts to set the names on the legend.
Steps to Reproduce:
Create a bar chart with a single color, label, and dataset item.
Replace the datasets, colors, and labels with correct data represeting 2+ dataset items.
Expected Behaviour
Replacing data on a bar chart that previusly had 1 data set item, with new data that has 2+ dataset items, the legend should appear and show the data.
Actual Behaviour
Replacing the datasets with 2+ items on a bar chart that only has 1 current dataset item will throw an error in the console and fail to render the chart:
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'textContent')
This is likely caused by the fact that a single dataset item bar chart does not create a legend. When replacing the data with something that now needs a legend, the code assumes one is present and attempts to set the names on the legend.
Steps to Reproduce:
NOTE: Add a GIF/Screenshot if required.
Frappé Charts version: 1.6.2 Codepen / Codesandbox: