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
)

(cherry picked from commit cfa0556)
  • Loading branch information
Lily Kuang authored and michael-s-molina committed Apr 4, 2024
1 parent 80ccb0c commit 863461d
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,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 863461d

Please sign in to comment.