mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
fix(bar-chart): change legend padding for horizontal orientation (#27883)
(cherry picked from commit cfa0556df7
)
This commit is contained in:
parent
1b7f599107
commit
300669f1e7
@ -561,6 +561,11 @@ export function getPadding(
|
|||||||
? TIMESERIES_CONSTANTS.yAxisLabelTopOffset
|
? TIMESERIES_CONSTANTS.yAxisLabelTopOffset
|
||||||
: 0;
|
: 0;
|
||||||
const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0;
|
const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0;
|
||||||
|
const showLegendTopOffset =
|
||||||
|
isHorizontal && showLegend && legendOrientation === LegendOrientation.Top
|
||||||
|
? 100
|
||||||
|
: 0;
|
||||||
|
|
||||||
return getChartPadding(
|
return getChartPadding(
|
||||||
showLegend,
|
showLegend,
|
||||||
legendOrientation,
|
legendOrientation,
|
||||||
@ -568,8 +573,12 @@ export function getPadding(
|
|||||||
{
|
{
|
||||||
top:
|
top:
|
||||||
yAxisTitlePosition && yAxisTitlePosition === 'Top'
|
yAxisTitlePosition && yAxisTitlePosition === 'Top'
|
||||||
? TIMESERIES_CONSTANTS.gridOffsetTop + (Number(yAxisTitleMargin) || 0)
|
? TIMESERIES_CONSTANTS.gridOffsetTop +
|
||||||
: TIMESERIES_CONSTANTS.gridOffsetTop + yAxisOffset,
|
showLegendTopOffset +
|
||||||
|
(Number(yAxisTitleMargin) || 0)
|
||||||
|
: TIMESERIES_CONSTANTS.gridOffsetTop +
|
||||||
|
showLegendTopOffset +
|
||||||
|
yAxisOffset,
|
||||||
bottom:
|
bottom:
|
||||||
zoomable && !isHorizontal
|
zoomable && !isHorizontal
|
||||||
? TIMESERIES_CONSTANTS.gridOffsetBottomZoomable + xAxisOffset
|
? TIMESERIES_CONSTANTS.gridOffsetBottomZoomable + xAxisOffset
|
||||||
|
Loading…
Reference in New Issue
Block a user