adding functionality to the default legend onClick function #10009
-
I suppose it's now (version 3.6.2) called: Chart.defaults.plugin.legend.onClick.call(this, evt, item) However, I then get the following error:
Originally posted by @CodeMazeSolver in #2437 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Using chrome dev tools this is the line in chart.js causing troubles: |
Beta Was this translation helpful? Give feedback.
-
https://www.chartjs.org/docs/latest/getting-started/v3-migration.html options: {
plugins: {
legend: {
onClick(evt, item) {
Chart.defaults.plugins.legend.onClick.call(this, evt, item, this);
// or Chart.defaults.plugins.legend.onClick(evt, item, this);
}
}
}
} |
Beta Was this translation helpful? Give feedback.
https://www.chartjs.org/docs/latest/getting-started/v3-migration.html
https://codepen.io/kurkle/pen/xxXrRjy