void drawGraph(float[] data) { int length = data.length; String[] labels = new String[length]; for (int i = 0; i < length; i++) { labels[i] = Integer.toString(i); } LineChartView lView = (LineChartView) findViewById(R.id.linechart); lView.reset(); LineSet dataSet = new LineSet(labels, data); // dataSet.setDotsRadius(15); dataSet.setDotsColor(0xFFFFFF); dataSet.setColor(0xBCCACF); // dataSet.setGradientFill(new int[]{0xFFFFFF, 0x20CE99}, new float[]{0, 1}); lView.setBackgroundColor(0x20CE99); // dataSet.setFill(0x20CE99); dataSet.setDotsStrokeColor(0xBCCACF); dataSet.setDotsStrokeThickness(10); Animation anim = new Animation(2000); anim.setEasing(new CircEase()); lView.setYLabels(AxisController.LabelPosition.NONE); // lView.setYAxis(false); Paint p = new Paint(); p.setColor(0xBCCACF); // lView.setValueThreshold(10, 10, p); lView.setAxisThickness(5); // LineSet threshLower = new LineSet(new String[]{"1", "2", "3", "4", "5", "6"}, new // float[]{10,10,10,10,10,10}); // LineSet threshLower = new LineSet(new String[]{"1", "2", "3", "4", "5", "6"}, new // float[]{10,10,10,10,10,10,}); // // threshLower.setColor(0x000000); // // threshLower.setDashed(new float[]{10, 10, 10, 10, 10, 10}); // threshLower.setSmooth(true); // threshLower.setThickness(5); lView.addData(createThresh(dataSet, 70)); lView.addData(createThresh(dataSet, 200)); lView.addData(dataSet); lView.show(anim); bGlucose = (TextView) findViewById(R.id.bglucose); setGlucoseLevel((int) data[length - 1]); }