Skip to content

Commit

Permalink
fix(bar-chart): change legend padding for horizontal orientation (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Kuang authored and jzhao62 committed Apr 4, 2024
1 parent 8d4ab21 commit 94b6b76
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 94b6b76

Please sign in to comment.