Skip to content

Commit 11a9df4

Browse files
authored
fix/new-50355 Moved Label up from Bar to allow hover on bar (#2062)
1 parent f454e89 commit 11a9df4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/chart/src/components/BarChart/components/BarChart.Vertical.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ export const BarChartVertical = () => {
244244
)
245245
// End Confidence Interval Variables
246246

247+
const BAR_LABEL_PADDING = 10
248+
247249
return (
248250
<Group key={`${barGroup.index}--${index}`}>
249251
<Group key={`bar-sub-group-${barGroup.index}-${barGroup.x0}-${barY}--${index}`}>
@@ -325,7 +327,7 @@ export const BarChartVertical = () => {
325327
display={displayBar ? 'block' : 'none'}
326328
opacity={transparentBar ? 0.5 : 1}
327329
x={hasConfidenceInterval ? barX + barWidth : barX + barWidth / 2}
328-
y={barY - 5}
330+
y={barY - BAR_LABEL_PADDING}
329331
fill={labelColor}
330332
textAnchor='middle'
331333
>
@@ -335,7 +337,7 @@ export const BarChartVertical = () => {
335337
display={displayBar ? 'block' : 'none'}
336338
opacity={transparentBar ? 0.5 : 1}
337339
x={barX + barWidth / 2}
338-
y={barY - 5}
340+
y={barY - BAR_LABEL_PADDING}
339341
fill={labelColor}
340342
textAnchor='middle'
341343
fontSize={config.isLollipopChart ? null : barWidth / 2}

0 commit comments

Comments
 (0)