From c4e3c45b3c24034205a1ceeb5387d63dc666a7fe Mon Sep 17 00:00:00 2001 From: Stephen Liu <750188453@qq.com> Date: Tue, 1 Mar 2022 14:53:53 +0800 Subject: [PATCH] fix(plugin-chart-echarts): fix customize margin (#18958) --- .../plugin-chart-echarts/src/Timeseries/transformers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 19fe600ca31c9..c357b2a40ee9d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts @@ -456,18 +456,18 @@ export function getPadding( const yAxisOffset = addYAxisTitleOffset ? TIMESERIES_CONSTANTS.yAxisLabelTopOffset : 0; - const xAxisOffset = addXAxisTitleOffset ? xAxisTitleMargin || 0 : 0; + const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0; return getChartPadding(showLegend, legendOrientation, margin, { top: yAxisTitlePosition && yAxisTitlePosition === 'Top' - ? TIMESERIES_CONSTANTS.gridOffsetTop + (yAxisTitleMargin || 0) + ? TIMESERIES_CONSTANTS.gridOffsetTop + (Number(yAxisTitleMargin) || 0) : TIMESERIES_CONSTANTS.gridOffsetTop + yAxisOffset, bottom: zoomable ? TIMESERIES_CONSTANTS.gridOffsetBottomZoomable + xAxisOffset : TIMESERIES_CONSTANTS.gridOffsetBottom + xAxisOffset, left: yAxisTitlePosition === 'Left' - ? TIMESERIES_CONSTANTS.gridOffsetLeft + (yAxisTitleMargin || 0) + ? TIMESERIES_CONSTANTS.gridOffsetLeft + (Number(yAxisTitleMargin) || 0) : TIMESERIES_CONSTANTS.gridOffsetLeft, right: showLegend && legendOrientation === LegendOrientation.Right