Search in sources :

Example 6 with SimpleLineChartValueFormatter

use of lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter in project xDrip-plus by jamorham.

the class BgGraphBuilder method treatmentValuesLine.

public Line[] treatmentValuesLine() {
    Line[] lines = new Line[9];
    try {
        lines[0] = new Line(treatmentValues);
        lines[0].setColor(getCol(X.color_treatment_dot_background));
        lines[0].setHasLines(false);
        lines[0].setPointRadius(pointSize * 5 / 2);
        lines[0].setHasPoints(true);
        lines[1] = new Line(treatmentValues);
        lines[1].setColor(getCol(X.color_treatment_dot_foreground));
        lines[1].setHasLines(false);
        lines[1].setPointRadius(pointSize * 5 / 4);
        lines[1].setHasPoints(true);
        lines[1].setShape(ValueShape.DIAMOND);
        lines[1].setHasLabels(true);
        LineChartValueFormatter formatter = new SimpleLineChartValueFormatter(1);
        lines[1].setFormatter(formatter);
        // insulin on board
        lines[2] = new Line(iobValues);
        lines[2].setColor(getCol(X.color_treatment));
        // need splitter for cubics
        lines[2].setHasLines(true);
        lines[2].setCubic(false);
        lines[2].setFilled(true);
        lines[2].setAreaTransparency(35);
        lines[2].setFilled(true);
        lines[2].setPointRadius(1);
        lines[2].setHasPoints(true);
        // lines[2].setShape(ValueShape.DIAMOND);
        // lines[2].setHasLabels(true);
        // iactivity on board
        lines[3] = new Line(activityValues);
        lines[3].setColor(getCol(X.color_treatment_dark));
        lines[3].setHasLines(false);
        lines[3].setCubic(false);
        lines[3].setFilled(false);
        lines[3].setFilled(false);
        lines[3].setPointRadius(1);
        lines[3].setHasPoints(true);
        // annotations
        lines[4] = new Line(annotationValues);
        lines[4].setColor(getCol(X.color_treatment_dot_foreground));
        lines[4].setHasLines(false);
        lines[4].setCubic(false);
        lines[4].setFilled(false);
        lines[4].setPointRadius(0);
        lines[4].setHasPoints(true);
        lines[4].setHasLabels(true);
        lines[5] = new Line(predictedBgValues);
        lines[5].setColor(getCol(X.color_predictive));
        lines[5].setHasLines(false);
        lines[5].setCubic(false);
        lines[5].setStrokeWidth(1);
        lines[5].setFilled(false);
        lines[5].setPointRadius(2);
        lines[5].setHasPoints(true);
        lines[5].setHasLabels(false);
        lines[6] = new Line(cobValues);
        lines[6].setColor(getCol(X.color_predictive_dark));
        lines[6].setHasLines(false);
        lines[6].setCubic(false);
        lines[6].setFilled(false);
        lines[6].setPointRadius(1);
        lines[6].setHasPoints(true);
        lines[6].setHasLabels(false);
        lines[7] = new Line(polyBgValues);
        lines[7].setColor(ChartUtils.COLOR_RED);
        lines[7].setHasLines(false);
        lines[7].setCubic(false);
        lines[7].setStrokeWidth(1);
        lines[7].setFilled(false);
        lines[7].setPointRadius(1);
        lines[7].setHasPoints(true);
        lines[7].setHasLabels(false);
        lines[8] = new Line(noisePolyBgValues);
        lines[8].setColor(ChartUtils.COLOR_ORANGE);
        lines[8].setHasLines(true);
        lines[8].setCubic(false);
        lines[8].setStrokeWidth(1);
        lines[8].setFilled(false);
        lines[8].setPointRadius(1);
        lines[8].setHasPoints(true);
        lines[8].setHasLabels(false);
    } catch (Exception e) {
        if (d)
            Log.i(TAG, "Exception making treatment lines: " + e.toString());
    }
    return lines;
}
Also used : TrendLine(com.eveningoutpost.dexdrip.Models.Forecast.TrendLine) PolyTrendLine(com.eveningoutpost.dexdrip.Models.Forecast.PolyTrendLine) Line(lecho.lib.hellocharts.model.Line) LineChartValueFormatter(lecho.lib.hellocharts.formatter.LineChartValueFormatter) SimpleLineChartValueFormatter(lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter) SimpleLineChartValueFormatter(lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter)

Aggregations

SimpleLineChartValueFormatter (lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter)6 Line (lecho.lib.hellocharts.model.Line)6 LineChartValueFormatter (lecho.lib.hellocharts.formatter.LineChartValueFormatter)4 PolyTrendLine (com.eveningoutpost.dexdrip.Models.Forecast.PolyTrendLine)2 TrendLine (com.eveningoutpost.dexdrip.Models.Forecast.TrendLine)2 ScaleMeasurement (com.health.openscale.core.datatypes.ScaleMeasurement)2 BMRMeasurementView (com.health.openscale.gui.views.BMRMeasurementView)2 FloatMeasurementView (com.health.openscale.gui.views.FloatMeasurementView)2 MeasurementView (com.health.openscale.gui.views.MeasurementView)2 ArrayList (java.util.ArrayList)2 Calendar (java.util.Calendar)2 Stack (java.util.Stack)2 Axis (lecho.lib.hellocharts.model.Axis)2 AxisValue (lecho.lib.hellocharts.model.AxisValue)2 LineChartData (lecho.lib.hellocharts.model.LineChartData)2 PointValue (lecho.lib.hellocharts.model.PointValue)2 DashPathEffect (android.graphics.DashPathEffect)1 PolynomialFitter (com.health.openscale.core.utils.PolynomialFitter)1 WeightMeasurementView (com.health.openscale.gui.views.WeightMeasurementView)1 SimpleDateFormat (java.text.SimpleDateFormat)1