Permalink
Browse files

Adding some helpful comments

  • Loading branch information...
1 parent 11ccb1d commit d02722d053d14237ceaf732ad5320d34baa7acab @matthewhudson matthewhudson committed Apr 12, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 sixpack/static/js/chart.js
@@ -97,9 +97,11 @@ $(function () {
my.svg.select("#" + line_id)
.data(data)
.on("mouseover", function (d) {
+ // Highlight line
var currClass = d3.select(this).attr("class");
d3.select(this).attr("class", currClass + " line-hover");
+ // Highlight corresponding table alternative
var table = $('.' + d3.event.target.id).closest('div').find('table')
table.find('tr').removeClass('highlight');
table.find('.' + d3.event.target.id).addClass('highlight');
@@ -113,12 +115,15 @@ $(function () {
.style("opacity", 1);
})
.on("mouseout", function (d) {
+ // Remove line highlight
d3.select(this).attr("class", "line");
var id = d3.event.target.id;
setTimeout(function () {
+ // Remove table highlight
$('.' + id).removeClass('highlight');
+ // Hide tooltip object
my.tooltip
.transition()
.duration(250)

0 comments on commit d02722d

Please sign in to comment.