         data.xVals = []
         dataSet.clear()
 
+        let dateFormatter = DateFormatter()
+        dateFormatter.locale = Locale(identifier: "en_US_POSIX")
+        dateFormatter.dateFormat = "eeeee"
+
         for (i, point) in feedDataPoints.enumerated() {
-          data.addXValue("\(point.time.timeIntervalSince1970)")
+          // We minus 1 day here, because we want the date to represent the previous day.
+          // For example:
+          //   [0].time is Thursday midnight, [1].time is Friday midnight.
+          //   [1].value - [0].value means kWh consumed on Thursday.
+          let time = point.time - 86400
+          data.addXValue(dateFormatter.string(from: time))
 
           let yDataEntry = BarChartDataEntry(value: point.value, xIndex: i)
           data.addEntry(yDataEntry, dataSetIndex: 0)

    barChart.noDataText = ""
    barChart.isUserInteractionEnabled = false
    barChart.extraBottomOffset = 2

    let xAxis = barChart.xAxis
    xAxis.labelPosition = .bottom
    xAxis.labelTextColor = .lightGray
    xAxis.drawGridLinesEnabled = false
    xAxis.drawAxisLineEnabled = false
    xAxis.valueFormatter = ChartXAxisDateFormatter()

    let dataSet = BarChartDataSet(yVals: nil, label: "kWh")
    dataSet.setColor(EmonCMSColors.Chart.Blue)
    dataSet.valueTextColor = .lightGray

    let data = BarChartData()
    data.addDataSet(dataSet)

    let xAxis = lineChart.xAxis
    xAxis.drawAxisLineEnabled = false
    xAxis.drawGridLinesEnabled = false
    xAxis.drawLabelsEnabled = true
    xAxis.labelPosition = .bottom
    xAxis.labelTextColor = .white
    xAxis.spaceBetweenLabels = 0
    xAxis.valueFormatter = ChartXAxisDateFormatter(formatString: "HH:mm")

    let yAxis = lineChart.leftAxis
    yAxis.labelPosition = .insideChart
    yAxis.drawTopYLabelEntryEnabled = false
    yAxis.drawGridLinesEnabled = false
    yAxis.drawAxisLineEnabled = false
    yAxis.labelTextColor = .white

    let dataSet = LineChartDataSet()
    dataSet.setColor(EmonCMSColors.Chart.Blue)
    dataSet.fillColor = EmonCMSColors.Chart.Blue
    dataSet.valueTextColor = .white
    dataSet.drawFilledEnabled = true
    dataSet.drawCirclesEnabled = false
    dataSet.drawValuesEnabled = false
