You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a dataset is spliced or shifted out of the array the stacked bars should drop to fill the space left by the missing data.
Current Behavior
When the data is specified in the Objects[] format, such as data: [{x: 10, y: 20}, {x: 15, y: 10}], gaps appear when datasets are spliced or shifted out.
Possible Solution
Looks like this might be similar to issues fixed in #6576. Here are some workarounds I've tested:
Don't use Object[] format for data
Set y-value for missing data to 0
When removing a dataset set the data to [] and keep the dataset rather than splicing it out
Steps to Reproduce
Create a stacked bar chart with data in Objects[] format and missing some values. Remove datasets by shifting or splicing.
Example codepen derived from sample stacked bar chart: https://codepen.io/scdehmlow/pen/WNodogK
Context
Using Objects[] format for my data helps keep my interface to Chart.js clean and my datasets will not always have values for every x value. I will be clearing the data rather than removing datasets for now.
Environment
Chart.js version: 3.0.0-beta.11
Browser name and version: Chrome 88.0.4324.190
Link to your project:
The text was updated successfully, but these errors were encountered:
Expected Behavior
When a dataset is spliced or shifted out of the array the stacked bars should drop to fill the space left by the missing data.
Current Behavior
When the data is specified in the
Objects[]
format, such asdata: [{x: 10, y: 20}, {x: 15, y: 10}]
, gaps appear when datasets are spliced or shifted out.Possible Solution
Looks like this might be similar to issues fixed in #6576. Here are some workarounds I've tested:
Object[]
format for data[]
and keep the dataset rather than splicing it outSteps to Reproduce
Create a stacked bar chart with data in
Objects[]
format and missing some values. Remove datasets by shifting or splicing.Example codepen derived from sample stacked bar chart:
https://codepen.io/scdehmlow/pen/WNodogK
Context
Using
Objects[]
format for my data helps keep my interface to Chart.js clean and my datasets will not always have values for every x value. I will be clearing the data rather than removing datasets for now.Environment
The text was updated successfully, but these errors were encountered: