Pass number format to tooltip (#9831)

This commit is contained in:
Ben McCann 2021-11-10 13:02:42 -08:00 committed by GitHub
parent 681ada552e
commit 7966227df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View 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);
}
}

View 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);
}
/**