1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Merge pull request #1729 from mperham/tight-labels-are-right

Fix labels to not move on mouseover
This commit is contained in:
Mike Perham 2014-05-21 17:29:51 -07:00
commit 95c4c4e05e
2 changed files with 20 additions and 2 deletions

View file

@ -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');

View file

@ -401,6 +401,12 @@ div.interval-slider input {
margin-top: 5px;
float: right;
}
#realtime-legend .timestamp,
#history-legend .timestamp {
display: inline-block;
width: 220px;
text-align: right;
}
#realtime-legend .line,
#history-legend .line {
display: inline-block;