D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
santiagogaray
Full window
Github gist
Tut1
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> </head> <body> <script> // Feel free to change or delete any of the code you see in this editor! var dataArray = [20, 40, 50]; var canvas = d3.select("body").append("svg") .attr("width", 500) .attr("height", 500); s = canvas.selectAll("svg") .append("line") //.x(function(d) {return d.x;}) var bars = canvas.selectAll("rect") .data(dataArray) .enter() .append("rect") .attr("width", function(d) {return d;}) .attr("height", 50) .attr("y", function(d, i) {return i *100}); </script> </body>
https://d3js.org/d3.v4.min.js