Example #1
0
  private Chart buildRefuelChart(List<Fuel> records) {
    Chart refuelList = new Chart();
    DateValueChart chartRow;
    for (Fuel record : records) {
      chartRow = new DateValueChart();
      chartRow.setDate(record.getDate());
      chartRow.setValue(record.getLiters());
      refuelList.add(chartRow);
    }

    return refuelList;
  }
Example #2
0
  private Chart buildDistanceChart(List<Fuel> records) {
    Chart distanceList = new Chart();
    DateValueChart chartRow;
    for (Fuel record : records) {
      chartRow = new DateValueChart();
      chartRow.setDate(record.getDate());
      chartRow.setValue(record.getDistance());
      distanceList.add(chartRow);
    }

    return distanceList;
  }