D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
gigiaa
Full window
Github gist
Gender Balance in parliaments of the world- 2013
<html> <head> <title>graphic</title> <script type="text/javascript" src="https://d3js.org/d3.v3.min.js"> </script> <style type="text/css"> body { background-color: lemonchiffon; } svg { background-color: lemonchiffon; } </style> </head> <body> <script type="text/javascript"> var svg = d3.select("body") .append("svg") .attr("width", 1000) .attr("height", 600); d3.csv("database.csv", function(data) { data.sort(function(a, b){ return d3.descending(a.year_2013, b.year_2013); }); var rects=svg.selectAll("rect") .data(data) .enter() .append("rect"); rects.attr("x", 0) rects.attr("y", function(d, i) { return i * 10; }) .attr("width", function(d) { return d.year_2013 * 90; }) .attr("height", 8) .append("title") .text(function(d){ return d.Country + "'s score of women in parliament is " + d.year_2013; }); }) </script> </body> </html>
Modified
http://d3js.org/d3.v3.min.js
to a secure url
https://d3js.org/d3.v3.min.js