practice 1
Last active
February 8, 2016 20:22
-
-
Save erikaris/465e40f86f64bf2d05a9 to your computer and use it in GitHub Desktop.
just practice....
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
<html> | |
<head> | |
<title> D3 Test </title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
test circle </br> | |
<svg width="100" height="100"> | |
<circle cx="50" cy="50" r="47" fill="blue" stroke="gray" stroke-width="2"/> | |
</svg> </br></br></br> | |
<script type="text/javascript"> | |
var dataset = [ 5, 10, 15, 20, 25 ]; | |
//d3.select("body").selectAll("p").data(dataset).enter().append("p").text("New paragraph!"); | |
d3.select("body").selectAll("p").data(dataset).enter().append("p").text(function(d) {return d;}).style("color", function(d) { | |
if(d>15) { | |
return "red"; | |
} else { | |
return "black"; | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment