From 3bd3c7cf00a6caa8975aa48db87473c2e2949a09 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 12 Aug 2024 15:12:08 +0800 Subject: [PATCH] fix(time): bar bandWidth with inversed time axis #20068 --- src/coord/axisHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coord/axisHelper.ts b/src/coord/axisHelper.ts index 53485fb31e..76d42a8d16 100644 --- a/src/coord/axisHelper.ts +++ b/src/coord/axisHelper.ts @@ -115,7 +115,7 @@ function adjustScaleForOverflow( // Get Axis Length const axisExtent = model.axis.getExtent(); - const axisLength = axisExtent[1] - axisExtent[0]; + const axisLength = Math.abs(axisExtent[1] - axisExtent[0]); // Get bars on current base axis and calculate min and max overflow const barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);