Commit 2aa6c063 authored by Kristian Tan's avatar Kristian Tan

format graph

parent 4c506a0a
...@@ -105,11 +105,10 @@ def main(): ...@@ -105,11 +105,10 @@ def main():
records = DailyUsage.query.all() records = DailyUsage.query.all()
for record in records: for record in records:
labels.append(record.date) labels.append(date(record.date.year, record.date.month, record.date.day))
values.append(record.kwhUsed) values.append(record.kwhUsed)
if record.kwhUsed > max: if record.kwhUsed > max:
max = record.kwhUsed max = record.kwhUsed
print(max)
template_data = { template_data = {
'pins': pins, 'pins': pins,
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
} }
// get bar chart canvas // get bar chart canvas
var mychart = document.getElementById("chart").getContext("2d"); var mychart = document.getElementById("chart").getContext("2d");
steps = 10 steps = 0.0000001
max = {{ max }} max = {{ max }}
// draw bar chart // draw bar chart
new Chart(mychart).Bar(barData, { new Chart(mychart).Bar(barData, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment