X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/09c67d9323c7d379d4c6de5dc0457b6de16cff14..814ebbe864806750e95c3df954a47f4b0007c5e4:/app/controllers/graph_controller.rb diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb index 7b593cc..e7668ff 100644 --- a/app/controllers/graph_controller.rb +++ b/app/controllers/graph_controller.rb @@ -150,17 +150,17 @@ class GraphController < ApplicationController labels_hash[0] = starttime.min.to_s labels_hash[(numcols/2)-1] = (starttime + (timedelta/2)).min.to_s labels_hash[numcols-1] = Time.now.min.to_s - interval_type = "Minutes" + interval_type = "Minute of the Hour" elsif timedelta < 2.days #more than 2 hours means use hours for labels labels_hash[0] = starttime.hour.to_s labels_hash[(numcols/2)-1] = (starttime + (timedelta/2)).hour.to_s labels_hash[numcols-1] = Time.now.hour.to_s - interval_type = "Hours" + interval_type = "Hour of the Day on 24 hour scale" else #more than 2 days means use dates for labels labels_hash[0] = (Date.parse(starttime.to_s)).to_s labels_hash[(numcols/2)-1] = (Date.parse(starttime + (timedelta/2))).to_s labels_hash[numcols-1] = (Date.today).to_s - interval_type = "Days" + interval_type = "The Date" end # Make sure to return an array for data and hash for labels