Java Code Examples for lecho.lib.hellocharts.model.Line#setAreaTransparency()

The following examples show how to use lecho.lib.hellocharts.model.Line#setAreaTransparency() . 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 avg1Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) avg1startfuzzed, (float) unitized(avg1value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg1value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average1_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{10.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 2
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
public Line avg2Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float) unitized(avg2value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg2value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average2_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{30.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 3
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
public Line idealLine() {
    // if profile has more than 1 target bg value then we need to iterate those and plot them for completeness
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float)  Profile.getTargetRangeInUnits(start_time)));
    myLineValues.add(new PointValue((float) predictive_end_time, (float) Profile.getTargetRangeInUnits(predictive_end_time)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_target_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{5f, 5f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 4
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
public Line predictiveLowLine() {
    List<PointValue> lowLineValues = new ArrayList<PointValue>();
    lowLineValues.add(new PointValue((float) end_time, (float) lowMark));
    lowLineValues.add(new PointValue((float) predictive_end_time, (float) lowMark));
    Line lowLine = new Line(lowLineValues);
    lowLine.setHasPoints(false);
    lowLine.setAreaTransparency(40);
    lowLine.setColor(ChartUtils.darkenColor(ChartUtils.darkenColor(ChartUtils.darkenColor(getCol(X.color_low_values)))));
    lowLine.setStrokeWidth(1);
    lowLine.setFilled(true);
    return lowLine;
}
 
Example 5
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
public Line avg1Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) avg1startfuzzed, (float) unitized(avg1value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg1value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average1_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{10.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 6
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
public Line avg2Line() {
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float) unitized(avg2value)));
    myLineValues.add(new PointValue((float) end_time, (float) unitized(avg2value)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_average2_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{30.0f, 10.0f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 7
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
public Line idealLine() {
    // if profile has more than 1 target bg value then we need to iterate those and plot them for completeness
    List<PointValue> myLineValues = new ArrayList<PointValue>();
    myLineValues.add(new PointValue((float) start_time, (float)  Profile.getTargetRangeInUnits(start_time)));
    myLineValues.add(new PointValue((float) predictive_end_time, (float) Profile.getTargetRangeInUnits(predictive_end_time)));
    Line myLine = new Line(myLineValues);
    myLine.setHasPoints(false);
    myLine.setStrokeWidth(1);
    myLine.setColor(getCol(X.color_target_line));
    myLine.setPathEffect(new DashPathEffect(new float[]{5f, 5f}, 0));
    myLine.setAreaTransparency(50);
    return myLine;
}
 
Example 8
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
public Line predictiveLowLine() {
    List<PointValue> lowLineValues = new ArrayList<PointValue>();
    lowLineValues.add(new PointValue((float) end_time, (float) lowMark));
    lowLineValues.add(new PointValue((float) predictive_end_time, (float) lowMark));
    Line lowLine = new Line(lowLineValues);
    lowLine.setHasPoints(false);
    lowLine.setAreaTransparency(40);
    lowLine.setColor(ChartUtils.darkenColor(ChartUtils.darkenColor(ChartUtils.darkenColor(getCol(X.color_low_values)))));
    lowLine.setStrokeWidth(1);
    lowLine.setFilled(true);
    return lowLine;
}
 
Example 9
Source File: BgGraphBuilder.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
private List<Line> motionLine() {

        final ArrayList<ActivityRecognizedService.motionData> motion_datas = ActivityRecognizedService.getForGraph((long) start_time * FUZZER, (long) end_time * FUZZER);
        List<PointValue> linePoints = new ArrayList<>();

        final float ypos = (float)highMark;
        int last_type = -9999;


        final ArrayList<Line> line_array = new ArrayList<>();

        Log.d(TAG,"Motion datas size: "+motion_datas.size());
        if (motion_datas.size() > 0) {
            motion_datas.add(new ActivityRecognizedService.motionData((long) end_time * FUZZER, DetectedActivity.UNKNOWN)); // terminator

            for (ActivityRecognizedService.motionData item : motion_datas) {

                Log.d(TAG, "Motion detail: " + JoH.dateTimeText(item.timestamp) + " activity: " + item.activity);
                if ((last_type != -9999) && (last_type != item.activity)) {
                    extend_line(linePoints, item.timestamp / FUZZER, ypos);
                    Line new_line = new Line(linePoints);
                    new_line.setHasLines(true);
                    new_line.setPointRadius(0);
                    new_line.setStrokeWidth(1);
                    new_line.setAreaTransparency(40);
                    new_line.setHasPoints(false);
                    new_line.setFilled(true);

                    switch (last_type) {
                        case DetectedActivity.IN_VEHICLE:
                            new_line.setColor(Color.parseColor("#70445599"));
                            break;
                        case DetectedActivity.ON_FOOT:
                            new_line.setColor(Color.parseColor("#70995599"));
                            break;
                    }
                    line_array.add(new_line);
                    linePoints = new ArrayList<>();
                }
                //current
                switch (item.activity) {
                    case DetectedActivity.ON_FOOT:
                    case DetectedActivity.IN_VEHICLE:
                        extend_line(linePoints, item.timestamp / FUZZER, ypos);
                        last_type = item.activity;
                        break;

                    default:
                        // do nothing?
                        break;
                }
            }

        }
        Log.d(TAG,"Motion array size: "+line_array.size());
            return line_array;
    }
 
Example 10
Source File: BgGraphBuilder.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
private List<Line> motionLine() {

        final ArrayList<ActivityRecognizedService.motionData> motion_datas = ActivityRecognizedService.getForGraph((long) start_time * FUZZER, (long) end_time * FUZZER);
        List<PointValue> linePoints = new ArrayList<>();

        final float ypos = (float)highMark;
        int last_type = -9999;


        final ArrayList<Line> line_array = new ArrayList<>();

        Log.d(TAG,"Motion datas size: "+motion_datas.size());
        if (motion_datas.size() > 0) {
            motion_datas.add(new ActivityRecognizedService.motionData((long) end_time * FUZZER, DetectedActivity.UNKNOWN)); // terminator

            for (ActivityRecognizedService.motionData item : motion_datas) {

                Log.d(TAG, "Motion detail: " + JoH.dateTimeText(item.timestamp) + " activity: " + item.activity);
                if ((last_type != -9999) && (last_type != item.activity)) {
                    extend_line(linePoints, item.timestamp / FUZZER, ypos);
                    Line new_line = new Line(linePoints);
                    new_line.setHasLines(true);
                    new_line.setPointRadius(0);
                    new_line.setStrokeWidth(1);
                    new_line.setAreaTransparency(40);
                    new_line.setHasPoints(false);
                    new_line.setFilled(true);

                    switch (last_type) {
                        case DetectedActivity.IN_VEHICLE:
                            new_line.setColor(Color.parseColor("#70445599"));
                            break;
                        case DetectedActivity.ON_FOOT:
                            new_line.setColor(Color.parseColor("#70995599"));
                            break;
                    }
                    line_array.add(new_line);
                    linePoints = new ArrayList<>();
                }
                //current
                switch (item.activity) {
                    case DetectedActivity.ON_FOOT:
                    case DetectedActivity.IN_VEHICLE:
                        extend_line(linePoints, item.timestamp / FUZZER, ypos);
                        last_type = item.activity;
                        break;

                    default:
                        // do nothing?
                        break;
                }
            }

        }
        Log.d(TAG,"Motion array size: "+line_array.size());
            return line_array;
    }