chartjs-plugin-datalabels icon indicating copy to clipboard operation
chartjs-plugin-datalabels copied to clipboard

Uncaught TypeError: expando is undefined

Open denis-migdal opened this issue 1 year ago • 0 comments

Related to #69

Error message:

Uncaught TypeError: expando is undefined
    beforeUpdate chartjs-plugin-datalabels.esm.js:1233
    callback helpers.segment.js:79
    _notify chart.js:5096
    notify chart.js:5079
    notifyPlugins chart.js:6361
    update chart.js:5899

Reproductive example: https://github.com/denis-migdal/ChartsHTML/tree/d45f9c3dc1336d1f1a6d7d3836f98d1b46fe05c2 Clone, start a Web server on the root, then open a web browser on /dist/dev/pages/playground/?example=js-datalabels

When you initially have:

plugins: {
					datalabels: false,
					//...
}

Update the graph, and then change it to :

plugins: {
					datalabels: {/*...*/},
					//...
}

It might cause the issue.

I am aware that doing datalabels: false is bad, and we should do datalabels: { display: false }.

But as it produces bug others had, I think this might help finding the cause of their issues.

On another note, could be nice to have a {enable: boolean} option like other Chart.js plugins.

denis-migdal avatar Nov 16 '24 19:11 denis-migdal