lecho.lib.hellocharts.formatter.LineChartValueFormatter Java Examples

The following examples show how to use lecho.lib.hellocharts.formatter.LineChartValueFormatter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
public Line[] treatmentValuesLine() {
    Line[] lines = new Line[2];
    try {

        lines[0] = new Line(treatmentValues);
        lines[0].setColor(highColor);//getCol(X.color_treatment_dot_background) 0xFFFFFF
        lines[0].setHasLines(false);
        lines[0].setPointRadius(pointSize * 5 / 3);//pointSize * 5 / 2
        lines[0].setHasPoints(true);
        lines[0].setShape(ValueShape.DIAMOND);//KS

        lines[1] = new Line(treatmentValues);
        lines[1].setColor(Color.GREEN);//getCol(X.color_treatment_dot_foreground)//0x77aa00 //lowColor
        lines[1].setHasLines(false);
        lines[1].setPointRadius(pointSize * 5 / 4);//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);

    } catch (Exception e) {
        if (d) UserError.Log.i(TAG, "Exception making treatment lines: " + e.toString());
    }
    return lines;
}
 
Example #2
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
public Line[] treatmentValuesLine() {
    Line[] lines = new Line[2];
    try {

        lines[0] = new Line(treatmentValues);
        lines[0].setColor(highColor);//getCol(X.color_treatment_dot_background) 0xFFFFFF
        lines[0].setHasLines(false);
        lines[0].setPointRadius(pointSize * 5 / 3);//pointSize * 5 / 2
        lines[0].setHasPoints(true);
        lines[0].setShape(ValueShape.DIAMOND);//KS

        lines[1] = new Line(treatmentValues);
        lines[1].setColor(Color.GREEN);//getCol(X.color_treatment_dot_foreground)//0x77aa00 //lowColor
        lines[1].setHasLines(false);
        lines[1].setPointRadius(pointSize * 5 / 4);//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);

    } catch (Exception e) {
        if (d) UserError.Log.i(TAG, "Exception making treatment lines: " + e.toString());
    }
    return lines;
}
 
Example #3
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
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;
}
 
Example #4
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
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;
}
 
Example #5
Source File: Line.java    From hellocharts-android with Apache License 2.0 4 votes vote down vote up
public LineChartValueFormatter getFormatter() {
    return formatter;
}
 
Example #6
Source File: Line.java    From hellocharts-android with Apache License 2.0 4 votes vote down vote up
public Line setFormatter(LineChartValueFormatter formatter) {
    if (null != formatter) {
        this.formatter = formatter;
    }
    return this;
}