private void setData(List<Integer> valueList, String format) {

    mChart.setVisibility(View.VISIBLE);

    ArrayList<String> xVals = new ArrayList<String>();
    ArrayList<BarEntry> yVals1 = new ArrayList<BarEntry>();

    if (valueList != null) {
      for (int i = 0; i < valueList.size(); i++) {
        xVals.add(i + "s");
        yVals1.add(new BarEntry(valueList.get(i), i));
      }
    }

    String legend = getResources().getString(R.string.caption_receptin_rate);

    if (!format.equals("%")) legend = getResources().getString(R.string.caption_packet_count);

    BarDataSet set1 = new BarDataSet(yVals1, legend);
    set1.setBarSpacePercent(35f);
    set1.setColor(Color.parseColor("#0288D1"));

    ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
    dataSets.add(set1);

    BarData data = new BarData(xVals, dataSets);
    data.setValueTextSize(10f);

    data.setDrawValues(false);

    YAxisValueFormatter custom = new DataAxisFormatter(format);
    YAxis leftAxis = mChart.getAxisLeft();
    YAxis rightAxis = mChart.getAxisRight();

    leftAxis.setValueFormatter(custom);
    rightAxis.setValueFormatter(custom);

    mChart.setData(data);
  }