D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
trinary
Full window
Github gist
simple bars, not quite right
Built with
blockbuilder.org
<!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 data = [ {value: 7}, {value: 20}, {value: 33}, {value: 9}, {value: 1}, {value: 44}, {value: 15}, {value: 26} ]; var svg = d3.select("svg"); var bars = svg.selectAll(".bars") .data(data); // !!! Uncomment the stuff below to see some bars! /* bars.enter() .append("rect") .classed("bars", true) .attr("x", function(d,i) { return 20 + (i * 40)}) .attr("y", 100) .attr("width", 20) .attr("height", function(d,i) { return d.value * 5;}) .style("fill","grey") */ </script> </body>
https://cdnjs.cloudflare.com/ajax/libs/d3/4.7.4/d3.min.js