block by sampathweb 2efd8084d345dd23ef96

datasana #circles

Full Screen

hello markdown

forked from sampathweb‘s block: datasana #1

index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>

  <style>
    body {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom:0;
    }
  </style>

</head>

<body>
  
  <svg width=960 height=500>
  </svg>
  <script>
    console.log("you are now rocking with d3", d3);
    var data = [5, 19, 20, 6, 29];
    var svg = d3.select("svg");
    var circles = svg.selectAll("circle")
    		.data(data)
    		.enter()
    	.append("circle")
    	.attr({
        r: 10,
        cx: function(d, i) { return 100 + i * 130},
        cy: function(d, i) {
          return 300 -  d * 9;
        }
      });
  </script>
</body>