From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Wed, 10 Nov 2021 21:02:42 +0000 (-0800) Subject: Pass number format to tooltip (#9831) X-Git-Tag: v3.6.1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7966227df36fdb3a79f35ac238ea8b5c84b3f3a8;p=thirdparty%2FChart.js.git Pass number format to tooltip (#9831) --- diff --git a/src/scales/scale.linearbase.js b/src/scales/scale.linearbase.js index 65631a618..346e0bc0d 100644 --- a/src/scales/scale.linearbase.js +++ b/src/scales/scale.linearbase.js @@ -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); } } diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index ba7f5237f..7ca55038c 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -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); } /**