Sparkline has a set x-axis now to prevent sparkline constantly re-adjusting axis.
#story[876]
This commit is contained in:
@@ -30,6 +30,7 @@ public class RaceController extends Controller {
|
|||||||
private ResizableRaceMap raceBoundaries;
|
private ResizableRaceMap raceBoundaries;
|
||||||
private ArrayList<String> colours;
|
private ArrayList<String> colours;
|
||||||
private Map<Integer, String> boatColours = new HashMap<>();
|
private Map<Integer, String> boatColours = new HashMap<>();
|
||||||
|
private int legNum;
|
||||||
@FXML SplitPane race;
|
@FXML SplitPane race;
|
||||||
@FXML CheckBox showFPS;
|
@FXML CheckBox showFPS;
|
||||||
@FXML CheckBox showBoatPath;
|
@FXML CheckBox showBoatPath;
|
||||||
@@ -126,6 +127,9 @@ public class RaceController extends Controller {
|
|||||||
xAxis.setTickMarkVisible(false);
|
xAxis.setTickMarkVisible(false);
|
||||||
xAxis.setTickLabelsVisible(false);
|
xAxis.setTickLabelsVisible(false);
|
||||||
xAxis.setMinorTickVisible(false);
|
xAxis.setMinorTickVisible(false);
|
||||||
|
xAxis.setUpperBound(startBoats.size()*legNum);
|
||||||
|
xAxis.setTickUnit(startBoats.size()*legNum);
|
||||||
|
|
||||||
|
|
||||||
// set y axis details
|
// set y axis details
|
||||||
yAxis.setLowerBound(-(startBoats.size()+1));
|
yAxis.setLowerBound(-(startBoats.size()+1));
|
||||||
@@ -160,7 +164,7 @@ public class RaceController extends Controller {
|
|||||||
public void startRace(VisualiserInput visualiserInput, RaceClock raceClock) {
|
public void startRace(VisualiserInput visualiserInput, RaceClock raceClock) {
|
||||||
StreamedRace newRace = new StreamedRace(visualiserInput, this);
|
StreamedRace newRace = new StreamedRace(visualiserInput, this);
|
||||||
//newRace.initialiseBoats();
|
//newRace.initialiseBoats();
|
||||||
|
legNum = visualiserInput.getCourse().getLegs().size()-1;
|
||||||
raceMap = new ResizableRaceCanvas(visualiserInput.getCourse());
|
raceMap = new ResizableRaceCanvas(visualiserInput.getCourse());
|
||||||
raceMap.setMouseTransparent(true);
|
raceMap.setMouseTransparent(true);
|
||||||
raceMap.widthProperty().bind(canvasBase.widthProperty());
|
raceMap.widthProperty().bind(canvasBase.widthProperty());
|
||||||
@@ -271,8 +275,8 @@ public class RaceController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xAxis.setUpperBound(sparkLineNumber);
|
// xAxis.setUpperBound(sparkLineNumber);
|
||||||
xAxis.setTickUnit(sparkLineNumber);
|
// xAxis.setTickUnit(sparkLineNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void makeColours() {
|
private void makeColours() {
|
||||||
|
|||||||
Reference in New Issue
Block a user