Built with blockbuilder.org
Last active
April 9, 2017 21:24
-
-
Save trinary/d5252820161c9b1ee340511c763583f3 to your computer and use it in GitHub Desktop.
dots
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
license: mit |
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> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.min.js"></script> | |
<style> | |
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } | |
svg { width:100%; height: 100% } | |
</style> | |
</head> | |
<body> | |
<svg></svg> | |
<script> | |
var myData = [1, 2, 4, 11, 5.5, 6]; | |
var svg = d3.select("svg") | |
var circles = svg.selectAll("circle").data(myData); | |
circles | |
.enter() | |
.append("circle") | |
.attr("cx", function(d) { return d * 50}) | |
.attr("cy", 111) | |
.attr("r", 10) | |
.style("fill", "#9C9393") | |
.style("stroke", "#D8A3A3") | |
.style("stroke-width", "2px"); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment