Creating a NumberAxis between 2 values with a tick count greater than 0 creates a duplicate of the first tick value
i.e. NumberAxis of 1 to 11 and a tick value of 2 yields (duplicate value of 1)
[1, 1, 3, 5, 7, 9, 11]
Example
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.chart.Axis;
import javafx.scene.chart.NumberAxis;
import javafx.stage.Stage;
public class NumberAxisExample extends Application
{
public void start(Stage primaryStage) throws Exception
{
NumberAxis axis = new NumberAxis(1, 11, 2);
Scene scene = new Scene(axis);
primaryStage.setScene(scene);
primaryStage.show();
ObservableList<Axis.TickMark<Number>> marks = axis.getTickMarks();
for (Axis.TickMark<Number> mark : marks)
{
Number value = mark.getValue();
System.out.println(value);
}
}
}
Output of running the above code
1.0
1.0
3.0
5.0
7.0
9.0
11.0
Expected
1.0
3.0
5.0
7.0
9.0
11.0
i.e. NumberAxis of 1 to 11 and a tick value of 2 yields (duplicate value of 1)
[1, 1, 3, 5, 7, 9, 11]
Example
import javafx.application.Application;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.chart.Axis;
import javafx.scene.chart.NumberAxis;
import javafx.stage.Stage;
public class NumberAxisExample extends Application
{
public void start(Stage primaryStage) throws Exception
{
NumberAxis axis = new NumberAxis(1, 11, 2);
Scene scene = new Scene(axis);
primaryStage.setScene(scene);
primaryStage.show();
ObservableList<Axis.TickMark<Number>> marks = axis.getTickMarks();
for (Axis.TickMark<Number> mark : marks)
{
Number value = mark.getValue();
System.out.println(value);
}
}
}
Output of running the above code
1.0
1.0
3.0
5.0
7.0
9.0
11.0
Expected
1.0
3.0
5.0
7.0
9.0
11.0