Last active
August 29, 2015 14:27
-
-
Save krish85/b63d99996025c9f4c4a0 to your computer and use it in GitHub Desktop.
Circle Color change
This file contains hidden or 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> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var svg = d3.select("body") | |
.append("svg") | |
.attr("width", 400) | |
.attr("height", 400); | |
svg.append("circle") | |
.style("stroke", "gray") | |
.style("fill", "white") | |
.attr("r", 50) | |
.attr("cx", 200) | |
.attr("cy", 200) | |
.on("mouseover", function(){d3.select(this).style("fill", "teal");}) | |
.on("mouseout", function(){d3.select(this).style("fill", "white");}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment