small fix for the sparkline so that it goes from 1 to 6 rather than 0 to 7 for a 6 boat race

#story[1087]
main
hba56 9 years ago
parent 9d9321522d
commit afadabfecc

@ -134,8 +134,8 @@ public class Sparkline {
xAxis.setTickUnit(1);
//Set y axis details
yAxis.setLowerBound(boats.size() + 1);
yAxis.setUpperBound(0);
yAxis.setLowerBound(boats.size());
yAxis.setUpperBound(1);
yAxis.setAutoRanging(false);
yAxis.setLabel("Position in Race");
yAxis.setTickUnit(-1);//Negative tick reverses the y axis.
@ -144,29 +144,6 @@ public class Sparkline {
yAxis.setTickLabelsVisible(true);
yAxis.setTickMarkVisible(true);
yAxis.setMinorTickVisible(true);
/* TODO FIX currently this doesn't work - I broke it :(
TODO only 0 and 7 get passed in to it for some reason
//Hide minus number from displaying on y axis.
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(Number value) {
//We only label the values between [1,boats.size()].
System.out.print("y axis: " + value.doubleValue());//TEMP remove
if ((value.doubleValue() >= 1)
&& (value.doubleValue() <= boats.size())) {
System.out.println(" is good");//TEMP
return String.format("%7.0f", value.doubleValue());
} else {
System.out.println(" is bad");//TEMP
return "";
}
}
});
*/
}

Loading…
Cancel
Save