Skip to content

Instantly share code, notes, and snippets.

@felix-last
Last active December 17, 2015 08:59
Show Gist options
  • Save felix-last/5584523 to your computer and use it in GitHub Desktop.
Save felix-last/5584523 to your computer and use it in GitHub Desktop.
var legend = document.querySelector('#legend');
$('<span></span>').addClass('value').appendTo('.label, #legend');
value_space = $('.value');
console.log(value_space);
var Hover = Rickshaw.Class.create(Rickshaw.Graph.HoverDetail, {
render: function(args) {
args.detail.sort(function(a, b) { return a.order - b.order }).forEach( function(d) {
var value = document.createElement('div');
value.className = 'value ';
value.innerHTML = ": " + d.formattedYValue;
if(d.name=='GBit Transferred')
$(value_space[0]).html(value);
if(d.name=='files Transferred')
$(value_space[1]).html(value);
$(value_space[2]).html(d.formattedXValue);
this.show();
}, this );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment