Describe the bug
Using a linear DefaultNumericAxis and setting setAutoRangeRounding(true) will always round to the next best integer number instead of the tick unit.
|
final double minRounded = round ? axisTransform.getRoundedMinimumRange(min) : min; |
LinearAxis doesn't have a transform and does the correct operation
|
minRounded = Math.floor(min / tickUnitRounded) * tickUnitRounded; |
Is it necessary to pass the tick unit to getRoundedMaximumRange etc.?
To Reproduce
import io.fair_acc.chartfx.axes.spi.AxisRange
import io.fair_acc.chartfx.axes.spi.DefaultNumericAxis
var axis = new DefaultNumericAxis();
axis.setAutoRanging(true);
axis.setAutoRangeRounding(true);
var range = axis.autoRange(0.001, 0.002, 1000, 0)
assert range.getMax() < 0.002 + range.getTickUnit() : "Range max grew multiple tick units"
Environment:
- OS: Win 10
- Java version: 17.0.9
- JavaFx version: 22.0.2
- ChartFx version: 7908d4c
Describe the bug
Using a linear
DefaultNumericAxisand settingsetAutoRangeRounding(true)will always round to the next best integer number instead of the tick unit.chart-fx/chartfx-chart/src/main/java/io/fair_acc/chartfx/axes/spi/DefaultNumericAxis.java
Line 353 in 7908d4c
LinearAxisdoesn't have a transform and does the correct operationchart-fx/chartfx-chart/src/main/java/io/fair_acc/chartfx/axes/spi/LinearAxis.java
Line 146 in 7908d4c
Is it necessary to pass the tick unit to
getRoundedMaximumRangeetc.?To Reproduce
Environment: