fix: use Math.ceil in linearDiscreteTicks()

This commit is contained in:
xile611 2023-11-21 16:29:19 +08:00
parent e5e59d6141
commit c90ea27034

View File

@ -118,7 +118,7 @@ export const linearDiscreteTicks = (scale: BandScale, op: ICartesianTickDataOpt)
const step =
rangeEnd - rangeStart - labelGap > 0
? Math.floor((domain.length * (labelGap + maxBounds[2])) / (rangeEnd - rangeStart - labelGap))
? Math.ceil((domain.length * (labelGap + maxBounds[2])) / (rangeEnd - rangeStart - labelGap))
: domain.length - 1;
scaleTicks = (scale as BandScale).stepTicks(step);