diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts index b5ff791fbefd2..3b5cfd594a70b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -563,6 +563,11 @@ export function getPadding( ? TIMESERIES_CONSTANTS.yAxisLabelTopOffset : 0; const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0; + const showLegendTopOffset = + isHorizontal && showLegend && legendOrientation === LegendOrientation.Top + ? 100 + : 0; + return getChartPadding( showLegend, legendOrientation, @@ -570,8 +575,12 @@ export function getPadding( { top: yAxisTitlePosition && yAxisTitlePosition === 'Top' - ? TIMESERIES_CONSTANTS.gridOffsetTop + (Number(yAxisTitleMargin) || 0) - : TIMESERIES_CONSTANTS.gridOffsetTop + yAxisOffset, + ? TIMESERIES_CONSTANTS.gridOffsetTop + + showLegendTopOffset + + (Number(yAxisTitleMargin) || 0) + : TIMESERIES_CONSTANTS.gridOffsetTop + + showLegendTopOffset + + yAxisOffset, bottom: zoomable && !isHorizontal ? TIMESERIES_CONSTANTS.gridOffsetBottomZoomable + xAxisOffset