You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define with let to avoid "assignment to constant" errors (#9803)
* Define with let to avoid "assignment to constant" errors
Thanks for this example. Defining `label` with `const` rather than `let` results in `Uncaught TypeError: Assignment to constant variable.`
* Another case where const needs to be replaced with let.
* Requested cases where const needs to be replaced with let +1 (style).
Copy file name to clipboardExpand all lines: docs/configuration/tooltip.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
Namespace: `options.plugins.tooltip`, the global options for the chart tooltips is defined in `Chart.defaults.plugins.tooltip`.
6
6
7
7
:::warning
8
-
The bubble, doughnut, pie, polar area, and scatter charts override the tooltip defaults. To change the overrides for those chart types, the options are defined in `Chart.overrides[type].plugins.tooltip`.
8
+
The bubble, doughnut, pie, polar area, and scatter charts override the tooltip defaults. To change the overrides for those chart types, the options are defined in `Chart.overrides[type].plugins.tooltip`.
9
9
:::
10
10
11
11
| Name | Type | Default | Description
@@ -157,7 +157,7 @@ const chart = new Chart(ctx, {
157
157
tooltip: {
158
158
callbacks: {
159
159
label:function(context) {
160
-
constlabel=context.dataset.label||'';
160
+
let label =context.dataset.label||'';
161
161
162
162
if (label) {
163
163
label +=': ';
@@ -282,7 +282,7 @@ const myPieChart = new Chart(ctx, {
0 commit comments