Skip to content

Commit 22fb4e9

Browse files
committed
fix: ensureLastLabel fixes
1 parent 3567a2a commit 22fb4e9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/charting/renderer/AxisRenderer.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ export abstract class AxisRenderer extends Renderer {
167167

168168
// Find out how much spacing (in y value space) between axis values
169169
const rawInterval = range / (labelCount - 1);
170-
let interval = axis.isForceIntervalEnabled() ? axis.getForcedInterval() : rawInterval;
171-
170+
let interval = axis.isForceIntervalEnabled() ? axis.getForcedInterval() : axis.ensureLastLabel ? rawInterval : Utils.roundToNextSignificant(rawInterval);
172171
// If granularity is enabled, then do not allow the interval to go below specified granularity.
173172
// This is used to avoid repeated values when rounding values for display.
174173
if (axis.isGranularityEnabled() && interval < axis.getGranularity()) {
@@ -233,9 +232,9 @@ export abstract class AxisRenderer extends Renderer {
233232
++n;
234233
}
235234
}
236-
if (axis.ensureLastLabel && (n - 1) * interval < last) {
237-
n++;
238-
}
235+
// if (axis.ensureLastLabel && (n - 1) * interval < last) {
236+
// n++;
237+
// }
239238

240239
axis.mEntryCount = n;
241240

0 commit comments

Comments
 (0)