D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
BrunoDumas
Full window
Github gist
test overflow
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> var data = ["fromage", "epinards", "chantage", "epinards", "chantage", "epinards", "chantage", "epinards", "chantage", "epinards", "chantage", "epinards", "chantage", "epinards", "chantage"]; var svg = d3.select("body").append("svg") .attr("width", 960) .attr("height", 500) var gListCat = svg.append("svg") .attr("width", 200) .attr("height", "100%") gListCat.append("rect") .style("fill", "red") .attr("y", 0) .attr("id", "catList") .attr("x", 0) .attr("width", 200) .attr("height", "100%") gListCat.selectAll("text").data(data).enter().append("text") .text(function(d){return d}) .attr("x", 20) .attr("y", function(d, i){return (1+i)*50}) </script> </body>
https://d3js.org/d3.v4.min.js