]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Respect the set locale for in the pie/doughnut tooltips (#8142)
authorEvert Timberg <evert.timberg+github@gmail.com>
Sun, 6 Dec 2020 23:17:22 +0000 (18:17 -0500)
committerGitHub <noreply@github.com>
Sun, 6 Dec 2020 23:17:22 +0000 (18:17 -0500)
src/controllers/controller.doughnut.js

index 499c9d1b91ae4feb32b301a4d6c9c2592209aaed..b71bc4c6c2368feef9746c42a313e85a6db1a915 100644 (file)
@@ -235,10 +235,11 @@ export default class DoughnutController extends DatasetController {
                const meta = me._cachedMeta;
                const chart = me.chart;
                const labels = chart.data.labels || [];
+               const value = new Intl.NumberFormat(chart.options.locale).format(meta._parsed[index]);
 
                return {
                        label: labels[index] || '',
-                       value: meta._parsed[index],
+                       value,
                };
        }