chartjs / chartjs/chartjs-plugin-datalabels

Uncaught TypeError: expando is undefined

Open
#424 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

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:
```ts
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.