private void setData(int start, int count, float range) {

    ArrayList<String> xVals = new ArrayList<String>();
    for (int i = 0; i < count; i++) {
      xVals.add((start + i) + "日");
    }

    ArrayList<Entry> vals1 = new ArrayList<Entry>();

    for (int i = 0; i < count; i++) {
      vals1.add(new Entry(TurnControl.PunchPerDay[9 - i], i));
    }

    // create a dataset and give it a type
    LineDataSet set1 = new LineDataSet(vals1, "近期打卡情况");
    set1.setDrawCubic(true);
    set1.setCubicIntensity(0.2f);
    set1.setDrawFilled(true);
    set1.setDrawCircles(true);
    set1.setLineWidth(2f);
    set1.setCircleSize(5f);
    set1.setHighLightColor(Color.rgb(244, 117, 117));
    set1.setColor(Color.rgb(104, 241, 175));
    set1.setFillColor(ColorTemplate.getHoloBlue());

    // create a data object with the datasets
    LineData data = new LineData(xVals, set1);
    data.setValueTypeface(tf);
    data.setValueTextSize(9f);
    data.setDrawValues(false);

    // set data
    mChart.setData(data);
  }
Ejemplo n.º 2
0
  private LineDataSet createSet() {
    LineDataSet set = new LineDataSet(null, "Dynamic Data");
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setColor(ColorTemplate.getHoloBlue());
    set.setCircleColor(Color.WHITE);
    set.setLineWidth(2f);
    set.setCircleSize(4f);
    set.setFillAlpha(65);
    set.setFillColor(ColorTemplate.getHoloBlue());
    set.setHighLightColor(Color.rgb(244, 117, 117));
    set.setValueTextColor(Color.WHITE);
    set.setValueTextSize(9f);
    set.setDrawValues(false);

    return set;
  }
Ejemplo n.º 3
0
  private LineDataSet createSet() {

    LineDataSet set = new LineDataSet(null, "Realtime Beschleunigungskraefte");
    set.setDrawCubic(true);
    set.setCubicIntensity(0.2f);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setColor(ColorTemplate.getHoloBlue());
    set.setCircleColor(Color.BLACK);
    set.setLineWidth(2f);
    set.setCircleSize(4f);
    set.setFillAlpha(65);
    set.setFillColor(ColorTemplate.getHoloBlue());
    set.setHighLightColor(Color.rgb(244, 117, 117));
    set.setValueTextColor(Color.BLACK);
    set.setValueTextSize(10f);
    return set;
  }
Ejemplo n.º 4
0
 @NonNull
 private LineDataSet setMaLine(int ma, ArrayList<String> xVals, ArrayList<Entry> lineEntries) {
   LineDataSet lineDataSetMa = new LineDataSet(lineEntries, "ma" + ma);
   if (ma == 5) {
     lineDataSetMa.setHighlightEnabled(true);
     lineDataSetMa.setDrawHorizontalHighlightIndicator(false);
     lineDataSetMa.setHighLightColor(Color.WHITE);
   } else {
       /*此处必须得写*/
     lineDataSetMa.setHighlightEnabled(false);
   }
   lineDataSetMa.setDrawValues(false);
   if (ma == 5) {
     lineDataSetMa.setColor(Color.GREEN);
   } else if (ma == 10) {
     lineDataSetMa.setColor(Color.GRAY);
   } else {
     lineDataSetMa.setColor(Color.YELLOW);
   }
   lineDataSetMa.setLineWidth(1f);
   lineDataSetMa.setDrawCircles(false);
   lineDataSetMa.setAxisDependency(YAxis.AxisDependency.LEFT);
   return lineDataSetMa;
 }