Skip to content

Commit

Permalink
fix(chart & heatmap): make to fix that y label is rendering out of bo…
Browse files Browse the repository at this point in the history
…unds (apache#20011)
  • Loading branch information
prosdev0107 authored and philipher29 committed Jun 9, 2022
1 parent 998747f commit 5fb5f7a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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,
Expand Down

0 comments on commit 5fb5f7a

Please sign in to comment.