Skip to content

Instantly share code, notes, and snippets.

View danielepalumbo89's full-sized avatar

Daniele Palumbo danielepalumbo89

View GitHub Profile
<!DOCTYPE html>
<meta charset="utf-8">
<style>
/* CSS goes here. */
body {
font: 12px sans-serif;
}
.axis path,
.axis line {
var width = 960,
height = 1160;
var formatNumber = d3.format(",.0f");
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height);
d3.json("uk.json", function(error, uk) {
var margin = {top: 20, right: 20, bottom: 170, left: 40},
width = 636 - margin.left - margin.right,
height = 380 - margin.top - margin.bottom; //PW Dimensions, delete margin bottom for better viz w/long x labels
var x = d3.scale.ordinal()
.rangeRoundBands([0, width], .1);
var y = d3.scale.linear()
.range([height, 0]);