Expected behavior
You should be able to have the skipNull option enabled and use the datasets in the example below.
const datasets = [
{ data: [1, 2] },
{ data: [1, 2, 3] },
]
Current behavior
It Crashes here, because item.controller.getParsed(dataIndex) returns undefined, you cannot use item.controller._cachedMeta.vScale.axis to access undefined.
Reproducible sample
https://codepen.io/therealsyler/pen/poaxgBJ
Optional extra steps/info to reproduce
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: [ 1,2 ],
datasets: [
{ data: [1, 2] },
{ data: [1, 2] }, // ,3
]
},
options: {
responsive: true,
skipNull: true,
}
});
Possible solution
Change this
From:
const val = item.controller.getParsed(dataIndex)[item.controller._cachedMeta.vScale.axis];
To:
const parsed = item.controller.getParsed(dataIndex)
const val = parsed && parsed[item.controller._cachedMeta.vScale.axis];
Context
No response
chart.js version
3.8.0
Browser name and version
No response
Link to your project
No response
Expected behavior
You should be able to have the
skipNulloption enabled and use the datasets in the example below.Current behavior
It Crashes here, because
item.controller.getParsed(dataIndex)returnsundefined, you cannot useitem.controller._cachedMeta.vScale.axisto accessundefined.Reproducible sample
https://codepen.io/therealsyler/pen/poaxgBJ
Optional extra steps/info to reproduce
Possible solution
Change this
From:
To:
Context
No response
chart.js version
3.8.0
Browser name and version
No response
Link to your project
No response