Skip to content

Commit 4d2f240

Browse files
committed
fix: account for minValue for Y-axis ticks step
1 parent 3fb4810 commit 4d2f240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/PrometheusGraph/_AxesGrid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function getValueTicks(metricUnits, minValue, maxValue) {
106106
: range(50).map(p => Math.pow(2, p));
107107
/* eslint-enable no-restricted-properties */
108108

109-
const step = find(steps, s => maxValue / s < 4);
109+
const step = find(steps, s => (maxValue - minValue) / s < 4);
110110

111111
// lodash `range()` doesn't include the end value in the returned array so we
112112
// add 1e-6 to move maxValue within the range

0 commit comments

Comments
 (0)