0👍
function handleValueChkChange() {
chart.options.plugins.datalabels.display= false;
Chart.update();
}
In your code, chart.option is camelCase And your Chart object is PascalCase?
You can define options as react state, and update state on demand after that call update method.
I implemented a example code for your problem and its will be work:
Sample Code
- Chartjs-Chart JS – Disable lines and Uncheck legends by default
- Chartjs-Lograthmic yaxsis setting not working in chartjs
Source:stackexchange.com