Skip to content

Commit

Permalink
fix(bar-chart): change legend padding for horizontal orientation (#27883
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Lily Kuang authored Apr 3, 2024
1 parent 27acc0b commit cfa0556
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,24 @@ 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,
margin,
{
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
Expand Down

0 comments on commit cfa0556

Please sign in to comment.