Cannot read properties of undefined (reading 'labels')
- Dominant language
- JavaScript
- Stars
- 67.7k
- Forks
- 11.9k
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 5
Description
### Expected behavior
When calling generateLabels and passing the current Chart object as a parameter I would expect the generateLabels function to run.
### Current behavior
When running generateLabels with the Chart object passed as a parameter it fails with TypeError: Cannot read properties of undefined (reading 'labels').

When debugging the Doughnut controller overrides generateLabels function I can see we try to get the data from "chart.data" but this property doesn't exist. Hoever, the chart.chart.data exist.

### Reproducible sample
https://codesandbox.io/s/chartjs-error-legend-labels-dhmrtd
### Optional extra steps/info to reproduce
_No response_
### Possible solution
_No response_
### Context
I'm not able to show the legend label on my chart.
### chart.js version
4.3.0
### Browser name and version
_No response_
### Link to your project
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.