D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
MTClass
Full window
Github gist
Class 1
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <div class="chart"></div> <script src="https://d3js.org/d3.v4.min.js"></script> <style> .chart div { font: 10px sans-serif; background-color: green; text-align: right; padding: 3px; margin: 1px; color: white; } </style> </head> <body> <script> var data = [4, 8, 15, 16, 23, 42, 55, 27, 44]; var x = d3.scaleLinear() .domain([0, d3.max(data)]) .range([0, 420]); d3.select(".chart") .selectAll("div") .data(data) .enter().append("div") .style("width", function(d) { return x(d) + "px"; }) .text(function(d) { return d; }); </script> </body>
https://d3js.org/d3.v4.min.js