Skip to content

Instantly share code, notes, and snippets.

@junkwhinger
Created February 19, 2016 15:41
Show Gist options
  • Save junkwhinger/4cea19f857a92eb0799a to your computer and use it in GitHub Desktop.
Save junkwhinger/4cea19f857a92eb0799a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
.title {
font: 20px helvetica;
fill: #404040;
}
.axis {
font: 12px helvetica;
fill: rgb(99,99,99);
}
.axis path,
.axis line {
color: red;
fill: none;
stroke: #000;
stroke-width: 1px;
}
.left.bar {
fill: #b8e186;
}
.right.bar {
fill: #f1b6da;
}
div.years_buttons {
display: flex;
justify-content: space-between;
width: 1000px;
}
div.years_buttons div {
font: 12px helvetica;
padding: 3px;
margin: 7px;
width: 55px;
text-align: center;
}
</style>
<script type="text/javascript">
function draw(data) {
// setting the d3 space
"use strict";
var width = 960,
height = 600;
var margin = {
top: 60,
right: 20,
bottom: 24,
left: 20,
middle: 28
};
// the width of each side of the chart
var regionWidth = width/2 - margin.middle;
// x-coordinates of the y-axes,
// cuz they should be in the middle
var pointA = regionWidth,
pointB = width - regionWidth;
// var years = [1925,1930,1935,1940,1944,1949,1955,1960,1966,1970,1975,1980,1985,1990,1995,2000,2005,2010];
var years = [1925,1930,1935,1940,1944,1949,1955,1960,1966,1970,1975,1980,1985,1990,1995,2000,2005,2010];
// setting the title
// d3.select("div.chart")
// .append("h2")
// .attr("class", "title")
// .text("Korean Population Structure - Year 1925");
// loading the very first batch of the population data
var first_data = data[1925];
// calculate the sum of the whole population of 1925
var totalPopulation = d3.sum(first_data, function(d) { return d.male + d.female; }),
percentage = function(d) { return d / totalPopulation; };
// setting the svg
var svg = d3.select('div.chart').append('svg')
.attr("class", "container")
.attr('width', margin.left + width + margin.right)
.attr('height', margin.top + height + margin.bottom)
.append('g')
.attr('transform', translation(margin.left, margin.top));
svg.append("text")
.attr("class", "title")
.attr("x", width/2)
.attr("y", 0 - (margin.top / 2))
.attr("text-anchor", "middle")
.text("Korean Population Structure - Year 1925");
// find the maximum data value on either side
// since this will be shared by both of the x-axes
var maxValue = Math.max(
d3.max(first_data, function(d) { return percentage(d.male); }),
d3.max(first_data, function(d) { return percentage(d.female); })
);
// SET UP SCALES
// the xScale goes from 0 to the width of a region
// it will be reversed for the left x-axis
var xScale = d3.scale.linear()
.domain([0, maxValue])
.range([0, regionWidth])
.nice();
var xScaleLeft = d3.scale.linear()
.domain([0, maxValue])
.range([regionWidth, 0]);
var xScaleRight = d3.scale.linear()
.domain([0, maxValue])
.range([0, regionWidth]);
var yScale = d3.scale.ordinal()
.domain(first_data.map(function(d) { return d.group; }))
.rangeRoundBands([height, 0], 0.1);
// SET UP AXES
var yAxisLeft = d3.svg.axis()
.scale(yScale)
.orient('right')
.tickSize(4,0)
.tickPadding(margin.middle-4);
var yAxisRight = d3.svg.axis()
.scale(yScale)
.orient('left')
.tickSize(4,0)
.tickFormat('');
var xAxisRight = d3.svg.axis()
.scale(xScale)
.orient('bottom')
.tickFormat(d3.format('.1%'));
var xAxisLeft = d3.svg.axis()
// REVERSE THE X-AXIS SCALE ON THE LEFT SIDE BY REVERSING THE RANGE
.scale(xScale.copy().range([pointA, 0]))
.orient('bottom')
.tickFormat(d3.format('.1%'));
// MAKE GROUPS FOR EACH SIDE OF CHART
// scale(-1,1) is used to reverse the left side so the bars grow left instead of right
var leftBarGroup = svg.append('g')
.attr('transform', translation(pointA, 0) + 'scale(-1,1)');
var rightBarGroup = svg.append('g')
.attr('transform', translation(pointB, 0));
// DRAW AXES
svg.append('g')
.attr('class', 'axis y left')
.attr('transform', translation(pointA, 0))
.call(yAxisLeft)
.selectAll('text')
.style('text-anchor', 'middle');
svg.append('g')
.attr('class', 'axis y right')
.attr('transform', translation(pointB, 0))
.call(yAxisRight);
svg.append('g')
.attr('class', 'axis x left')
.attr('transform', translation(0, height))
.call(xAxisLeft);
svg.append('g')
.attr('class', 'axis x right')
.attr('transform', translation(pointB, height))
.call(xAxisRight);
var null_data = [{
"group": "0-4",
"male": 0,
"female": 0
}, {
"group": "5-9",
"male": 0,
"female": 0
}, {
"group": "10-14",
"male": 0,
"female": 0
}, {
"group": "15-19",
"male": 0,
"female": 0
}, {
"group": "20-24",
"male": 0,
"female": 0
}, {
"group": "25-29",
"male": 0,
"female": 0
}, {
"group": "30-34",
"male": 0,
"female": 0
}, {
"group": "35-39",
"male": 0,
"female": 0
}, {
"group": "40-44",
"male": 0,
"female": 0
}, {
"group": "45-49",
"male": 0,
"female": 0
}, {
"group": "50-54",
"male": 0,
"female": 0
}, {
"group": "55-59",
"male": 0,
"female": 0
}, {
"group": "60-64",
"male": 0,
"female": 0
}, {
"group": "65-69",
"male": 0,
"female": 0
}, {
"group": "70-74",
"male": 0,
"female": 0
}, {
"group": "75-79",
"male": 0,
"female": 0
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
];
leftBarGroup.selectAll('.bar.left')
.data(null_data)
.enter().append('rect')
.attr('class', 'bar left')
.attr('x', 0)
.attr('y', function(d) { return yScale(d.group); })
.attr('width', function(d) { return xScale(percentage(d.male)); })
.attr('height', yScale.rangeBand());
rightBarGroup.selectAll('.bar.right')
.data(null_data)
.enter().append('rect')
.attr('class', 'bar right')
.attr('x', 0)
.attr('y', function(d) { return yScale(d.group); })
.attr('width', function(d) { return xScale(percentage(d.female)); })
.attr('height', yScale.rangeBand());
leftBarGroup.selectAll('.bar.left')
.data(first_data)
.transition()
.duration(10)
.attr('width', function(d) { return xScale(percentage(d.male)); })
.attr('height', yScale.rangeBand());
rightBarGroup.selectAll('.bar.right')
.data(first_data)
.transition()
.duration(10)
.attr('width', function(d) { return xScale(percentage(d.female)); })
.attr('height', yScale.rangeBand());
// so sick of string concatenation for translations
function translation(x,y) {
return 'translate(' + x + ',' + y + ')';
}
function update(year) {
var filtered = data[year]
d3.select(".title")
.text("Korean Population Structure - Year " + year)
var totalPopulation = d3.sum(filtered, function(d) { return d.male + d.female; }),
percentage = function(d) { return d / totalPopulation; };
var maxValue = Math.max(
d3.max(filtered, function(d) { return percentage(d.male); }),
d3.max(filtered, function(d) { return percentage(d.female); })
);
var xScale = d3.scale.linear()
.domain([0, maxValue])
.range([0, regionWidth])
.nice();
var xAxisRight = d3.svg.axis()
.scale(xScale)
.orient('bottom')
.tickFormat(d3.format('.1%'));
var xAxisLeft = d3.svg.axis()
// REVERSE THE X-AXIS SCALE ON THE LEFT SIDE BY REVERSING THE RANGE
.scale(xScale.copy().range([pointA, 0]))
.orient('bottom')
.tickFormat(d3.format('.1%'));
svg.selectAll('.axis.x.left')
.transition()
.duration(500)
.call(xAxisLeft);
svg.selectAll('.axis.x.right')
.transition()
.duration(500)
.call(xAxisRight);
// bar update and transition
leftBarGroup.selectAll('rect.bar.left')
.data(filtered)
.transition()
.duration(500)
.attr('width', function(d) { return xScale(percentage(d.male)); })
.attr('height', yScale.rangeBand());
rightBarGroup.selectAll('rect.bar.right')
.data(filtered)
.transition()
.duration(500)
.attr('width', function(d) { return xScale(percentage(d.female)); })
.attr('height', yScale.rangeBand());
}
var year_idx = 1;
var year_interval = setInterval(function() {
update(years[year_idx]);
year_idx++;
if(year_idx >= years.length) {
clearInterval(year_interval);
var buttons = d3.select("div.chart")
.append("div")
.attr("class", "years_buttons")
.selectAll("div")
.data(years)
.enter()
.append("div")
.text(function(d) {
return d;
});
buttons.on("click", function(d) {
d3.select(".years_buttons")
.selectAll("div")
.transition()
.duration(500)
.style("color", "black")
.style("background", "white");
d3.select(this)
.transition()
.duration(500)
.style("background", "black")
.style("color", "white");
update(d)
})
} else {
console.log("it's okay")
}}, 1000);
}
</script>
</head>
<body>
<div class="chart"></div>
<script type="text/javascript">
d3.json("korea_population_sample.json", draw);
</script>
</body>
</html>
{
"1925": [{
"group": "0-4",
"male": 1560053,
"female": 1509533
}, {
"group": "5-9",
"male": 1200503,
"female": 1123590
}, {
"group": "10-14",
"male": 1117122,
"female": 1040101
}, {
"group": "15-19",
"male": 964186,
"female": 912881
}, {
"group": "20-24",
"male": 749424,
"female": 720859
}, {
"group": "25-29",
"male": 754495,
"female": 718047
}, {
"group": "30-34",
"male": 654292,
"female": 605105
}, {
"group": "35-39",
"male": 594448,
"female": 545399
}, {
"group": "40-44",
"male": 497970,
"female": 451578
}, {
"group": "45-49",
"male": 425428,
"female": 392262
}, {
"group": "50-54",
"male": 347447,
"female": 326250
}, {
"group": "55-59",
"male": 291999,
"female": 296371
}, {
"group": "60-64",
"male": 231498,
"female": 248627
}, {
"group": "65-69",
"male": 181586,
"female": 207868
}, {
"group": "70-74",
"male": 94614,
"female": 112990
}, {
"group": "75-79",
"male": 45498,
"female": 58776
}, {
"group": "80-84",
"male": 12674,
"female": 18238
}, {
"group": "85+",
"male": 2913,
"female": 5405
}
],
"1930": [{
"group": "0-4",
"male": 1661240,
"female": 1620443
}, {
"group": "5-9",
"male": 1361625,
"female": 1296035
}, {
"group": "10-14",
"male": 1153608,
"female": 1066871
}, {
"group": "15-19",
"male": 1058199,
"female": 993740
}, {
"group": "20-24",
"male": 860573,
"female": 850970
}, {
"group": "25-29",
"male": 692154,
"female": 679822
}, {
"group": "30-34",
"male": 706726,
"female": 677336
}, {
"group": "35-39",
"male": 618681,
"female": 578721
}, {
"group": "40-44",
"male": 548241,
"female": 507159
}, {
"group": "45-49",
"male": 460921,
"female": 428224
}, {
"group": "50-54",
"male": 379603,
"female": 357839
}, {
"group": "55-59",
"male": 305594,
"female": 302361
}, {
"group": "60-64",
"male": 235138,
"female": 248612
}, {
"group": "65-69",
"male": 171553,
"female": 196183
}, {
"group": "70-74",
"male": 114519,
"female": 137739
}, {
"group": "75-79",
"male": 50191,
"female": 66432
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
],
"1935": [{
"group": "0-4",
"male": 1864127,
"female": 1807454
}, {
"group": "5-9",
"male": 1478064,
"female": 1408407
}, {
"group": "10-14",
"male": 1301810,
"female": 1229821
}, {
"group": "15-19",
"male": 1080314,
"female": 1021591
}, {
"group": "20-24",
"male": 959748,
"female": 937281
}, {
"group": "25-29",
"male": 811545,
"female": 802225
}, {
"group": "30-34",
"male": 652568,
"female": 633374
}, {
"group": "35-39",
"male": 669307,
"female": 639446
}, {
"group": "40-44",
"male": 572611,
"female": 540153
}, {
"group": "45-49",
"male": 508714,
"female": 482679
}, {
"group": "50-54",
"male": 409120,
"female": 388381
}, {
"group": "55-59",
"male": 334045,
"female": 331983
}, {
"group": "60-64",
"male": 248205,
"female": 255063
}, {
"group": "65-69",
"male": 179466,
"female": 202173
}, {
"group": "70-74",
"male": 113398,
"female": 134568
}, {
"group": "75-79",
"male": 62583,
"female": 83215
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
],
"1940": [{
"group": "0-4",
"male": 1974157,
"female": 1923501
}, {
"group": "5-9",
"male": 1655425,
"female": 1581813
}, {
"group": "10-14",
"male": 1398317,
"female": 1322947
}, {
"group": "15-19",
"male": 1142250,
"female": 1121413
}, {
"group": "20-24",
"male": 908119,
"female": 926974
}, {
"group": "25-29",
"male": 845382,
"female": 859217
}, {
"group": "30-34",
"male": 725152,
"female": 731569
}, {
"group": "35-39",
"male": 606498,
"female": 598909
}, {
"group": "40-44",
"male": 608860,
"female": 592442
}, {
"group": "45-49",
"male": 515050,
"female": 501824
}, {
"group": "50-54",
"male": 445617,
"female": 439414
}, {
"group": "55-59",
"male": 355954,
"female": 357287
}, {
"group": "60-64",
"male": 270603,
"female": 281946
}, {
"group": "65-69",
"male": 186391,
"female": 205490
}, {
"group": "70-74",
"male": 115515,
"female": 140678
}, {
"group": "75-79",
"male": 56882,
"female": 76336
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
],
"1944": [{
"group": "0-4",
"male": 2159146,
"female": 2119472
}, {
"group": "5-9",
"male": 1815269,
"female": 1747262
}, {
"group": "10-14",
"male": 1545793,
"female": 1462954
}, {
"group": "15-19",
"male": 1174771,
"female": 1175654
}, {
"group": "20-24",
"male": 889337,
"female": 979989
}, {
"group": "25-29",
"male": 812916,
"female": 858660
}, {
"group": "30-34",
"male": 768255,
"female": 799205
}, {
"group": "35-39",
"male": 675127,
"female": 681636
}, {
"group": "40-44",
"male": 575438,
"female": 563422
}, {
"group": "45-49",
"male": 554141,
"female": 531905
}, {
"group": "50-54",
"male": 451506,
"female": 451128
}, {
"group": "55-59",
"male": 366961,
"female": 377014
}, {
"group": "60-64",
"male": 293122,
"female": 314342
}, {
"group": "65-69",
"male": 200965,
"female": 225093
}, {
"group": "70-74",
"male": 136940,
"female": 165109
}, {
"group": "75-79",
"male": 65901,
"female": 88320
}, {
"group": "80-84",
"male": 24464,
"female": 36987
}, {
"group": "85+",
"male": 11121,
"female": 20849
}
],
"1949": [{
"group": "0-4",
"male": 0,
"female": 0
}, {
"group": "5-9",
"male": 2991580,
"female": 2886197
}, {
"group": "10-14",
"male": 1282027,
"female": 1232613
}, {
"group": "15-19",
"male": 1029625,
"female": 993026
}, {
"group": "20-24",
"male": 863715,
"female": 854011
}, {
"group": "25-29",
"male": 759752,
"female": 735565
}, {
"group": "30-34",
"male": 652043,
"female": 613678
}, {
"group": "35-39",
"male": 589925,
"female": 552259
}, {
"group": "40-44",
"male": 488270,
"female": 459063
}, {
"group": "45-49",
"male": 393673,
"female": 380476
}, {
"group": "50-54",
"male": 340893,
"female": 340741
}, {
"group": "55-59",
"male": 294192,
"female": 322327
}, {
"group": "60-64",
"male": 485605,
"female": 590121
}, {
"group": "65-69",
"male": 0,
"female": 0
}, {
"group": "70-74",
"male": 0,
"female": 0
}, {
"group": "75-79",
"male": 0,
"female": 0
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
],
"1955": [{
"group": "0-4",
"male": 1742778,
"female": 1633870
}, {
"group": "5-9",
"male": 1495871,
"female": 1371517
}, {
"group": "10-14",
"male": 1371568,
"female": 1249453
}, {
"group": "15-19",
"male": 1256904,
"female": 1138007
}, {
"group": "20-24",
"male": 808143,
"female": 946257
}, {
"group": "25-29",
"male": 635243,
"female": 803884
}, {
"group": "30-34",
"male": 679017,
"female": 710431
}, {
"group": "35-39",
"male": 585542,
"female": 583037
}, {
"group": "40-44",
"male": 530158,
"female": 523904
}, {
"group": "45-49",
"male": 496405,
"female": 451476
}, {
"group": "50-54",
"male": 337483,
"female": 342418
}, {
"group": "55-59",
"male": 295560,
"female": 319434
}, {
"group": "60-64",
"male": 217405,
"female": 263101
}, {
"group": "65-69",
"male": 156405,
"female": 203113
}, {
"group": "70-74",
"male": 80971,
"female": 110771
}, {
"group": "75-79",
"male": 0,
"female": 0
}, {
"group": "80-84",
"male": 0,
"female": 0
}, {
"group": "85+",
"male": 0,
"female": 0
}
],
"1960": [{
"group": "0-4",
"male": 1820312,
"female": 1729252
}, {
"group": "5-9",
"male": 1958379,
"female": 1823172
}, {
"group": "10-14",
"male": 1480279,
"female": 1341976
}, {
"group": "15-19",
"male": 1248791,
"female": 1134363
}, {
"group": "20-24",
"male": 1175602,
"female": 1103847
}, {
"group": "25-29",
"male": 916751,
"female": 996435
}, {
"group": "30-34",
"male": 727096,
"female": 829238
}, {
"group": "35-39",
"male": 687559,
"female": 729178
}, {
"group": "40-44",
"male": 598867,
"female": 588603
}, {
"group": "45-49",
"male": 518017,
"female": 515744
}, {
"group": "50-54",
"male": 444283,
"female": 440293
}, {
"group": "55-59",
"male": 318745,
"female": 345793
}, {
"group": "60-64",
"male": 257447,
"female": 309124
}, {
"group": "65-69",
"male": 174206,
"female": 230526
}, {
"group": "70-74",
"male": 120719,
"female": 173283
}, {
"group": "75-79",
"male": 55635,
"female": 85028
}, {
"group": "80-84",
"male": 25744,
"female": 42696
}, {
"group": "85+",
"male": 8186,
"female": 15983
}
],
"1966": [{
"group": "0-4",
"male": 2318664,
"female": 2162257
}, {
"group": "5-9",
"male": 2391295,
"female": 2221577
}, {
"group": "10-14",
"male": 1857472,
"female": 1732555
}, {
"group": "15-19",
"male": 1399246,
"female": 1308900
}, {
"group": "20-24",
"male": 1203321,
"female": 1095362
}, {
"group": "25-29",
"male": 1116120,
"female": 1128214
}, {
"group": "30-34",
"male": 975994,
"female": 983780
}, {
"group": "35-39",
"male": 734345,
"female": 818450
}, {
"group": "40-44",
"male": 659331,
"female": 687495
}, {
"group": "45-49",
"male": 559889,
"female": 556646
}, {
"group": "50-54",
"male": 465588,
"female": 482044
}, {
"group": "55-59",
"male": 376426,
"female": 412297
}, {
"group": "60-64",
"male": 248035,
"female": 302918
}, {
"group": "65-69",
"male": 182750,
"female": 254634
}, {
"group": "70-74",
"male": 104987,
"female": 162301
}, {
"group": "75-79",
"male": 62232,
"female": 109437
}, {
"group": "80-84",
"male": 20423,
"female": 39207
}, {
"group": "85+",
"male": 7932,
"female": 17416
}
],
"1970": [{
"group": "0-4",
"male": 2228736,
"female": 2087407
}, {
"group": "5-9",
"male": 2349086,
"female": 2182856
}, {
"group": "10-14",
"male": 2274301,
"female": 2119047
}, {
"group": "15-19",
"male": 1573179,
"female": 1514955
}, {
"group": "20-24",
"male": 1298687,
"female": 1224483
}, {
"group": "25-29",
"male": 1096819,
"female": 1107474
}, {
"group": "30-34",
"male": 1108853,
"female": 1084426
}, {
"group": "35-39",
"male": 915069,
"female": 939131
}, {
"group": "40-44",
"male": 691062,
"female": 770841
}, {
"group": "45-49",
"male": 628934,
"female": 655694
}, {
"group": "50-54",
"male": 506554,
"female": 517981
}, {
"group": "55-59",
"male": 407895,
"female": 447146
}, {
"group": "60-64",
"male": 302362,
"female": 362896
}, {
"group": "65-69",
"male": 181431,
"female": 253284
}, {
"group": "70-74",
"male": 120835,
"female": 194609
}, {
"group": "75-79",
"male": 60931,
"female": 114485
}, {
"group": "80-84",
"male": 26355,
"female": 57481
}, {
"group": "85+",
"male": 8526,
"female": 21441
}
],
"1975": [{
"group": "0-4",
"male": 2189456,
"female": 2037904
}, {
"group": "5-9",
"male": 2302542,
"female": 2151156
}, {
"group": "10-14",
"male": 2348676,
"female": 2178654
}, {
"group": "15-19",
"male": 2124156,
"female": 2022756
}, {
"group": "20-24",
"male": 1611767,
"female": 1511359
}, {
"group": "25-29",
"male": 1271743,
"female": 1235707
}, {
"group": "30-34",
"male": 1131486,
"female": 1092752
}, {
"group": "35-39",
"male": 1111449,
"female": 1077695
}, {
"group": "40-44",
"male": 885250,
"female": 914903
}, {
"group": "45-49",
"male": 649961,
"female": 748859
}, {
"group": "50-54",
"male": 576664,
"female": 620715
}, {
"group": "55-59",
"male": 449224,
"female": 489981
}, {
"group": "60-64",
"male": 334479,
"female": 403073
}, {
"group": "65-69",
"male": 229780,
"female": 313047
}, {
"group": "70-74",
"male": 123219,
"female": 201994
}, {
"group": "75-79",
"male": 68241,
"female": 136049
}, {
"group": "80-84",
"male": 26304,
"female": 64613
}, {
"group": "85+",
"male": 10843,
"female": 32509
}
],
"1980": [{
"group": "0-4",
"male": 1963963,
"female": 1830729
}, {
"group": "5-9",
"male": 2282813,
"female": 2138133
}, {
"group": "10-14",
"male": 2293386,
"female": 2146751
}, {
"group": "15-19",
"male": 2186973,
"female": 2052756
}, {
"group": "20-24",
"male": 2067729,
"female": 1985909
}, {
"group": "25-29",
"male": 1540965,
"female": 1541207
}, {
"group": "30-34",
"male": 1293533,
"female": 1225708
}, {
"group": "35-39",
"male": 1127158,
"female": 1096183
}, {
"group": "40-44",
"male": 1080457,
"female": 1051194
}, {
"group": "45-49",
"male": 868659,
"female": 913154
}, {
"group": "50-54",
"male": 609166,
"female": 716759
}, {
"group": "55-59",
"male": 521797,
"female": 603556
}, {
"group": "60-64",
"male": 373222,
"female": 448835
}, {
"group": "65-69",
"male": 260597,
"female": 359686
}, {
"group": "70-74",
"male": 161867,
"female": 263229
}, {
"group": "75-79",
"male": 74175,
"female": 155111
}, {
"group": "80-84",
"male": 31546,
"female": 86661
}, {
"group": "85+",
"male": 11296,
"female": 41946
}
],
"1985": [{
"group": "0-4",
"male": 1922758,
"female": 1779797
}, {
"group": "5-9",
"male": 2025353,
"female": 1890997
}, {
"group": "10-14",
"male": 2310570,
"female": 2165415
}, {
"group": "15-19",
"male": 2227322,
"female": 2088942
}, {
"group": "20-24",
"male": 2185720,
"female": 2059370
}, {
"group": "25-29",
"male": 2027185,
"female": 2043223
}, {
"group": "30-34",
"male": 1589610,
"female": 1525628
}, {
"group": "35-39",
"male": 1324369,
"female": 1256812
}, {
"group": "40-44",
"male": 1108685,
"female": 1078823
}, {
"group": "45-49",
"male": 1042989,
"female": 1046223
}, {
"group": "50-54",
"male": 809619,
"female": 885640
}, {
"group": "55-59",
"male": 560580,
"female": 707177
}, {
"group": "60-64",
"male": 440387,
"female": 566489
}, {
"group": "65-69",
"male": 306710,
"female": 416107
}, {
"group": "70-74",
"male": 190553,
"female": 310701
}, {
"group": "75-79",
"male": 103513,
"female": 208577
}, {
"group": "80-84",
"male": 36163,
"female": 101497
}, {
"group": "85+",
"male": 15140,
"female": 60588
}
],
"1990": [{
"group": "0-4",
"male": 1726863,
"female": 1552927
}, {
"group": "5-9",
"male": 1999001,
"female": 1853507
}, {
"group": "10-14",
"male": 2054494,
"female": 1937423
}, {
"group": "15-19",
"male": 2267129,
"female": 2181867
}, {
"group": "20-24",
"male": 2294290,
"female": 2102019
}, {
"group": "25-29",
"male": 2160912,
"female": 2172588
}, {
"group": "30-34",
"male": 2142825,
"female": 2064889
}, {
"group": "35-39",
"male": 1648205,
"female": 1553005
}, {
"group": "40-44",
"male": 1315182,
"female": 1224087
}, {
"group": "45-49",
"male": 1100966,
"female": 1075924
}, {
"group": "50-54",
"male": 994511,
"female": 1015507
}, {
"group": "55-59",
"male": 760993,
"female": 861860
}, {
"group": "60-64",
"male": 494845,
"female": 662214
}, {
"group": "65-69",
"male": 375752,
"female": 524562
}, {
"group": "70-74",
"male": 233308,
"female": 361808
}, {
"group": "75-79",
"male": 127905,
"female": 249266
}, {
"group": "80-84",
"male": 54861,
"female": 140451
}, {
"group": "85+",
"male": 18830,
"female": 75496
}
],
"1995": [{
"group": "0-4",
"male": 1821350,
"female": 1606059
}, {
"group": "5-9",
"male": 1626922,
"female": 1469193
}, {
"group": "10-14",
"male": 1913801,
"female": 1798179
}, {
"group": "15-19",
"male": 1987044,
"female": 1876447
}, {
"group": "20-24",
"male": 2237940,
"female": 2066438
}, {
"group": "25-29",
"male": 2078417,
"female": 2059496
}, {
"group": "30-34",
"male": 2146351,
"female": 2083888
}, {
"group": "35-39",
"male": 2103016,
"female": 2030848
}, {
"group": "40-44",
"male": 1579850,
"female": 1491251
}, {
"group": "45-49",
"male": 1261509,
"female": 1202786
}, {
"group": "50-54",
"male": 1028887,
"female": 1034881
}, {
"group": "55-59",
"male": 923625,
"female": 989836
}, {
"group": "60-64",
"male": 673719,
"female": 821363
}, {
"group": "65-69",
"male": 420873,
"female": 623106
}, {
"group": "70-74",
"male": 293696,
"female": 468848
}, {
"group": "75-79",
"male": 160498,
"female": 295175
}, {
"group": "80-84",
"male": 71267,
"female": 174924
}, {
"group": "85+",
"male": 28370,
"female": 103448
}
],
"2000": [{
"group": "0-4",
"male": 1641166,
"female": 1489092
}, {
"group": "5-9",
"male": 1813446,
"female": 1612610
}, {
"group": "10-14",
"male": 1615013,
"female": 1449429
}, {
"group": "15-19",
"male": 1913885,
"female": 1777699
}, {
"group": "20-24",
"male": 2028206,
"female": 1819980
}, {
"group": "25-29",
"male": 2057321,
"female": 2039657
}, {
"group": "30-34",
"male": 2068202,
"female": 2025026
}, {
"group": "35-39",
"male": 2117492,
"female": 2069461
}, {
"group": "40-44",
"male": 2029413,
"female": 1966923
}, {
"group": "45-49",
"male": 1496104,
"female": 1455919
}, {
"group": "50-54",
"male": 1185239,
"female": 1165011
}, {
"group": "55-59",
"male": 959680,
"female": 1008792
}, {
"group": "60-64",
"male": 836465,
"female": 952384
}, {
"group": "65-69",
"male": 593974,
"female": 782148
}, {
"group": "70-74",
"male": 348226,
"female": 569895
}, {
"group": "75-79",
"male": 211347,
"female": 389251
}, {
"group": "80-84",
"male": 94135,
"female": 209624
}, {
"group": "85+",
"male": 39715,
"female": 133491
}
],
"2005": [{
"group": "0-4",
"male": 1237301,
"female": 1145049
}, {
"group": "5-9",
"male": 1654228,
"female": 1514659
}, {
"group": "10-14",
"male": 1816328,
"female": 1618573
}, {
"group": "15-19",
"male": 1626378,
"female": 1474145
}, {
"group": "20-24",
"male": 1915902,
"female": 1746221
}, {
"group": "25-29",
"male": 1858332,
"female": 1813515
}, {
"group": "30-34",
"male": 2059913,
"female": 2036369
}, {
"group": "35-39",
"male": 2065668,
"female": 2047117
}, {
"group": "40-44",
"male": 2082427,
"female": 2040614
}, {
"group": "45-49",
"male": 1961859,
"female": 1939040
}, {
"group": "50-54",
"male": 1426597,
"female": 1428700
}, {
"group": "55-59",
"male": 1126997,
"female": 1151441
}, {
"group": "60-64",
"male": 897384,
"female": 991469
}, {
"group": "65-69",
"male": 755949,
"female": 924118
}, {
"group": "70-74",
"male": 514241,
"female": 738493
}, {
"group": "75-79",
"male": 270632,
"female": 496238
}, {
"group": "80-84",
"male": 136705,
"female": 295554
}, {
"group": "85+",
"male": 58819,
"female": 174469
}
],
"2010": [{
"group": "0-4",
"male": 1142220,
"female": 1076864
}, {
"group": "5-9",
"male": 1243294,
"female": 1151369
}, {
"group": "10-14",
"male": 1654964,
"female": 1518262
}, {
"group": "15-19",
"male": 1826179,
"female": 1612235
}, {
"group": "20-24",
"male": 1625371,
"female": 1430049
}, {
"group": "25-29",
"male": 1802805,
"female": 1736144
}, {
"group": "30-34",
"male": 1866397,
"female": 1828951
}, {
"group": "35-39",
"male": 2060233,
"female": 2038914
}, {
"group": "40-44",
"male": 2071431,
"female": 2059992
}, {
"group": "45-49",
"male": 2044641,
"female": 2028717
}, {
"group": "50-54",
"male": 1887973,
"female": 1910158
}, {
"group": "55-59",
"male": 1360747,
"female": 1405948
}, {
"group": "60-64",
"male": 1057035,
"female": 1125201
}, {
"group": "65-69",
"male": 833242,
"female": 978926
}, {
"group": "70-74",
"male": 672894,
"female": 893120
}, {
"group": "75-79",
"male": 410726,
"female": 673641
}, {
"group": "80-84",
"male": 186008,
"female": 409501
}, {
"group": "85+",
"male": 94736,
"female": 271873
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment