chartjs / chartjs/chartjs-plugin-datalabels

Pie Chart Labels are broken

Open
#387 5 comments 4 reactions 0 assignees View on GitHub
needs test case
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

It looks like that the labels are broken with Pie Chart labels in the latest ChartJs

```
chartjs-plugin-datalabels.esm.js:118 Uncaught TypeError: Cannot read properties of null (reading 'x')
at orient (chartjs-plugin-datalabels.esm.js:118:19)
at Object.fallback [as positioner] (chartjs-plugin-datalabels.esm.js:342:13)
at coordinates (chartjs-plugin-datalabels.esm.js:838:21)
at Object.draw (chartjs-plugin-datalabels.esm.js:1009:18)
at Object.afterDatasetsDraw (chartjs-plugin-datalabels.esm.js:1302:12)
at callback (helpers.core.ts:109:15)
at PluginService._notify (core.plugins.js:60:11)
at PluginService.notify (core.plugins.js:42:25)
at Chart.notifyPlugins (core.controller.js:1148:26)
at Chart._drawDatasets (core.controller.js:787:10)
```

_Originally posted by @tedik123 in https://github.com/chartjs/chartjs-plugin-datalabels/issues/380#issuecomment-1631647819_

There is a PR #380 which looks like it fixes this problem, according to the PR it is an issue where `instanceof` no longer works in newer versions of ChartJs

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.