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
  • Loading branch information
prosdev0107 committed May 10, 2022
1 parent 62e1c34 commit 288c262
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 288c262

Please sign in to comment.