D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
diegobarcena
Full window
Github gist
Ejercicio 6
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v5.min.js"></script> <style> body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } .barras div { margin: 2px; padding: 10px; text-align: right; color: white; } </style> </head> <body> <h1>BarĂ³metro Junio GAD3</h1> <svg width="400" height="100"> <rect/> <rect/> <rect/> <rect/> <svg/> <script> d3.csv("junioGAD3.csv").then(datos => { //console.table(datos) d3.selectAll(".barras div") .data(datos) .text(d => d.nombre) .style("background-color", d => d.color) .style("width", d => 2*d.escanos + 'px') }); </script> </body>
https://d3js.org/d3.v5.min.js