]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Pass number format to tooltip (#9831)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Wed, 10 Nov 2021 21:02:42 +0000 (13:02 -0800)
committerGitHub <noreply@github.com>
Wed, 10 Nov 2021 21:02:42 +0000 (16:02 -0500)
src/scales/scale.linearbase.js
src/scales/scale.logarithmic.js

index 65631a618a18c22b2dfaeec67d6e05d1c0cbafdc..346e0bc0d4abef0569bd50fa23ad7c15d712a7d4 100644 (file)
@@ -312,6 +312,6 @@ export default class LinearScaleBase extends Scale {
   }
 
   getLabelForValue(value) {
-    return formatNumber(value, this.chart.options.locale);
+    return formatNumber(value, this.chart.options.locale, this.options.ticks.format);
   }
 }
index ba7f5237f26a005d5c8f2a4453e4c837f3312cac..7ca55038c271b3dde5aa87f3d7ec0cb93b96d536 100644 (file)
@@ -146,7 +146,9 @@ export default class LogarithmicScale extends Scale {
         * @return {string}
         */
   getLabelForValue(value) {
-    return value === undefined ? '0' : formatNumber(value, this.chart.options.locale);
+    return value === undefined
+      ? '0'
+      : formatNumber(value, this.chart.options.locale, this.options.ticks.format);
   }
 
   /**