Skip to content

Commit c54295c

Browse files
committed
Make the gap between chart and x labels constant
1 parent 12a54aa commit c54295c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/Charts/BarChart/BarChartContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function BarChartContent({data, isLoading, yAxisUnit, yAxisUnitPosition = 'left'
231231
fontMgr={fontMgr}
232232
labelColor={theme.textSupporting}
233233
xScale={args.xScale}
234-
chartBoundsBottom={data.some((p) => p.total < 0) ? args.chartBounds.bottom : args.yScale(0)}
234+
chartBoundsBottom={args.yScale(Math.min(...args.yTicks))}
235235
/>
236236
<ChartYAxisLabels
237237
yTicks={args.yTicks}

src/components/Charts/LineChart/LineChartContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function LineChartContent({data, isLoading, yAxisUnit, yAxisUnitPosition = 'left
223223
fontMgr={fontMgr}
224224
labelColor={theme.textSupporting}
225225
xScale={args.xScale}
226-
chartBoundsBottom={data.some((p) => p.total < 0) ? args.chartBounds.bottom : args.yScale(0)}
226+
chartBoundsBottom={args.yScale(Math.min(...args.yTicks))}
227227
/>
228228
)}
229229
{!!fontMgr && (

0 commit comments

Comments
 (0)