Skip to content

Commit 7da856a

Browse files
committed
Added the Math.max(0, ...) clamp to match the pattern used in columnFormat.ts
1 parent 3ea9562 commit 7da856a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/webapp/app/components/code/QueryResultsChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ function createYAxisFormatter(
11211121
if (value === 0) return "0 B";
11221122
// Use consistent unit for all ticks based on max value
11231123
const i = Math.min(
1124-
Math.floor(Math.log(Math.abs(maxVal || 1)) / Math.log(divisor)),
1124+
Math.max(0, Math.floor(Math.log(Math.abs(maxVal || 1)) / Math.log(divisor))),
11251125
units.length - 1
11261126
);
11271127
const scaled = value / Math.pow(divisor, i);

0 commit comments

Comments
 (0)