Last active
December 23, 2015 21:19
-
-
Save vicapow/6695426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
</head> | |
<body> | |
<style> | |
.bar{ | |
height: 10px; | |
background-color: blue; | |
border-bottom: 1px solid white; | |
} | |
</style> | |
<div class="bar"></div> | |
<div class="bar"></div> | |
<div class="bar"></div> | |
<script> | |
// set the width of the three bars in our bar chart, then remove them after 3 seconds. | |
d3.selectAll('.bar') | |
.data([10, 30, 60]) | |
.style('width', function(d, i){ return d + '%'; }) | |
.data([]) | |
.exit() | |
.transition() | |
.duration(2000) | |
.style('opacity', '0.0') | |
.remove(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment