Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed multiple tips being displayed during sort #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions chapter_10/13_svg_tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//Width and height
var w = 600;
var h = 250;

var dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13,
11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ];

Expand All @@ -30,7 +30,7 @@
var yScale = d3.scaleLinear()
.domain([0, d3.max(dataset)])
.range([0, h]);

//Create SVG element
var svg = d3.select("body")
.append("svg")
Expand Down Expand Up @@ -75,18 +75,18 @@

})
.on("mouseout", function() {

//Remove the tooltip
d3.select("#tooltip").remove();
d3.selectAll("#tooltip").remove();

})
.on("click", function() {
sortBars();
});

//Define sort order flag
var sortOrder = false;

//Define sort function
var sortBars = function() {

Expand All @@ -110,8 +110,8 @@
return xScale(i);
});

};
};

</script>
</body>
</html>
</html>