fix(chart & heatmap): make to fix that y label is rendering out of bounds (#20011)

This commit is contained in:
smileydev 2022-05-20 13:54:42 -05:00 committed by GitHub
parent e766f8cb57
commit 56e96950c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -111,7 +111,7 @@ function Heatmap(element, props) {
let showY = true;
let showX = true;
const pixelsPerCharX = 4.5; // approx, depends on font size
const pixelsPerCharY = 6; // approx, depends on font size
let pixelsPerCharY = 6; // approx, depends on font size
const valueFormatter = getNumberFormatter(numberFormat);
@ -121,6 +121,7 @@ function Heatmap(element, props) {
let longestY = 1;
records.forEach(datum => {
if (typeof datum.y === 'number') pixelsPerCharY = 7;
longestX = Math.max(
longestX,
(datum.x && datum.x.toString().length) || 1,