use of lecho.lib.hellocharts.formatter.AxisValueFormatter in project xDrip-plus by jamorham.
the class BasalChart method chartYAxis.
// TODO recalculate axis on every change
@NonNull
public static Axis chartYAxis(float max_height) {
Axis yAxis = new Axis();
yAxis.setAutoGenerated(false);
yAxis.setHasLines(true);
// max_height = max_height * 3;
final float yStep = chooseClosestStep(max_height / 20f);
// rounding???
final List<AxisValue> axisValues = new ArrayList<>();
// TODO autoscale this - rebuild on data change??
for (float j = 0; j <= max_height + yStep; j += yStep) {
axisValues.add(new AxisValue(j));
}
yAxis.setValues(axisValues);
// yAxis.setHasLines(true);
yAxis.setMaxLabelChars(5);
yAxis.setInside(false);
// yAxis.setTextSize(axisTextSize);
AxisValueFormatter formatter = new SimpleAxisValueFormatter(2);
yAxis.setFormatter(formatter);
return yAxis;
}
use of lecho.lib.hellocharts.formatter.AxisValueFormatter in project xDrip by NightscoutFoundation.
the class BasalChart method chartYAxis.
// TODO recalculate axis on every change
@NonNull
public static Axis chartYAxis(float max_height) {
Axis yAxis = new Axis();
yAxis.setAutoGenerated(false);
yAxis.setHasLines(true);
// max_height = max_height * 3;
final float yStep = chooseClosestStep(max_height / 20f);
// rounding???
final List<AxisValue> axisValues = new ArrayList<>();
// TODO autoscale this - rebuild on data change??
for (float j = 0; j <= max_height + yStep; j += yStep) {
axisValues.add(new AxisValue(j));
}
yAxis.setValues(axisValues);
// yAxis.setHasLines(true);
yAxis.setMaxLabelChars(5);
yAxis.setInside(false);
// yAxis.setTextSize(axisTextSize);
AxisValueFormatter formatter = new SimpleAxisValueFormatter(2);
yAxis.setFormatter(formatter);
return yAxis;
}
Aggregations