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; }
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; }