Skip to content

Uncaught TypeError: expando is undefined #424

Open
@denis-migdal

Description

@denis-migdal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions