diff --git a/web/assets/javascripts/dashboard.js b/web/assets/javascripts/dashboard.js index 75c0b01b..65f9ffd6 100644 --- a/web/assets/javascripts/dashboard.js +++ b/web/assets/javascripts/dashboard.js @@ -48,7 +48,13 @@ var realtimeGraph = function(updatePath) { var legend = document.querySelector('#realtime-legend'); var Hover = Rickshaw.Class.create(Rickshaw.Graph.HoverDetail, { render: function(args) { - legend.innerHTML = args.formattedXValue; + + legend.innerHTML = ""; + + var timestamp = document.createElement('div'); + timestamp.className = 'timestamp'; + timestamp.innerHTML = args.formattedXValue; + legend.appendChild(timestamp); args.detail.sort(function(a, b) { return a.order - b.order }).forEach( function(d) { var line = document.createElement('div'); @@ -149,7 +155,13 @@ var historyGraph = function() { var legend = document.querySelector('#history-legend'); var Hover = Rickshaw.Class.create(Rickshaw.Graph.HoverDetail, { render: function(args) { - legend.innerHTML = args.formattedXValue; + + legend.innerHTML = ""; + + var timestamp = document.createElement('div'); + timestamp.className = 'timestamp'; + timestamp.innerHTML = args.formattedXValue; + legend.appendChild(timestamp); args.detail.sort(function(a, b) { return a.order - b.order }).forEach( function(d) { var line = document.createElement('div'); diff --git a/web/assets/stylesheets/application.css b/web/assets/stylesheets/application.css index 50e68f54..6bf3fe40 100755 --- a/web/assets/stylesheets/application.css +++ b/web/assets/stylesheets/application.css @@ -401,6 +401,12 @@ div.interval-slider input { margin-top: 5px; float: right; } +#realtime-legend .timestamp, +#history-legend .timestamp { + display: inline-block; + width: 250px; + text-align: right; +} #realtime-legend .line, #history-legend .line { display: inline-block;