Skip to content

Instantly share code, notes, and snippets.

@erikaris
Last active February 8, 2016 20:22
Show Gist options
  • Save erikaris/465e40f86f64bf2d05a9 to your computer and use it in GitHub Desktop.
Save erikaris/465e40f86f64bf2d05a9 to your computer and use it in GitHub Desktop.
just practice....
<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