diff --git a/packages/osd-charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts b/packages/osd-charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts index a23d5a6d5016..a45cf3c468cb 100644 --- a/packages/osd-charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts +++ b/packages/osd-charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts @@ -81,9 +81,8 @@ export const computeChartDimensionsSelector = createCachedSelector( }; }); const measuredYValues = textMeasure(config.yAxisLabel.fontSize, boxedYValues); - const maxTextWidth = d3Max(measuredYValues, ({ width }) => width) ?? 0; - let yColumnWidth: number = maxTextWidth; + let yColumnWidth: number = d3Max(measuredYValues, ({ width }) => width) ?? 0; if (typeof config.yAxisLabel.width === 'number') { yColumnWidth = config.yAxisLabel.width; } else if (typeof config.yAxisLabel.width === 'object' && yColumnWidth > config.yAxisLabel.width.max) { diff --git a/packages/osd-charts/src/chart_types/heatmap/state/selectors/get_x_axis_right_overflow.ts b/packages/osd-charts/src/chart_types/heatmap/state/selectors/get_x_axis_right_overflow.ts index d8c78846c7b4..61c734f24902 100644 --- a/packages/osd-charts/src/chart_types/heatmap/state/selectors/get_x_axis_right_overflow.ts +++ b/packages/osd-charts/src/chart_types/heatmap/state/selectors/get_x_axis_right_overflow.ts @@ -52,7 +52,7 @@ export const getXAxisRightOverflow = createCachedSelector( const textSize = bboxCompute.compute(text, padding, fontSize, fontFamily, 1); return Math.max(acc, textSize.width + padding); }, 0); - + bboxCompute.destroy(); return maxTextWidth / 2; }, )(getChartIdSelector);