Skip to content

Bug: chartjs-plugin-datalabels throws Cannot read properties of null (reading 'x') on pie/doughnut charts in Filament #440

@NikFarees

Description

@NikFarees

Bug: chartjs-plugin-datalabels crashes on pie / doughnut charts with Cannot read properties of null (reading 'x')

Summary

When using chartjs-plugin-datalabels in a Filament ChartWidget, line and bar charts work as expected, but pie and doughnut charts throw a runtime error in the browser console.

The chart still renders in some cases, but the plugin crashes during draw / hover lifecycle.

Error

filament-chart-js-plugins-GIOcJBUD.js:2 Uncaught TypeError: Cannot read properties of null (reading 'x')
    at Xt (filament-chart-js-plugins-GIOcJBUD.js:2:587)
    at Object.fallback [as positioner] (filament-chart-js-plugins-GIOcJBUD.js:2:2287)
    at He (filament-chart-js-plugins-GIOcJBUD.js:2:7473)
    at Object.draw (filament-chart-js-plugins-GIOcJBUD.js:2:8998)
    at Object.afterDatasetsDraw (filament-chart-js-plugins-GIOcJBUD.js:2:11522)
    at W (chart.js?v=5.3.5.0:1:8440)
    at Yn._notify (chart.js?v=5.3.5.0:1:112904)
    at Yn.notify (chart.js?v=5.3.5.0:1:112690)
    at yt.notifyPlugins (chart.js?v=5.3.5.0:1:131066)
    at yt._drawDatasets (chart.js?v=5.3.5.0:1:127305)

Screenshots

Image Image

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