FiscalNote Bar Chart
by Adam Nekola
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="//use.typekit.net/zht7wtz.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<div id="graphic">
<div id="container" style="height: 400px;"></div>
<div id="credit">Source: FiscalNote Prophecy
<img src="https://fiscalnote.com/assets/logos/logosmall_153-77918c53b25bc34c07e07f712e719d18.png"/>
</div>
</div>
CSS
* {
font-family: "proxima-nova",sans-serif;
}
#graphic { width: 300px; }
#graphic .wide { width: 600px; }
#credit {
padding: 10px;
background:#f4f4f4;
font-size:0.7em;
line-height:20px;
color:#aaa;
}
#credit img {
height: 20px;
width:auto;
float:right;
}
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
colors: ['#AC6FB5', '#B5ADBC'],
title: {
text: 'Historic World Population by Region',
align: 'left',
style: {
fontWeight: 'bold',
fontSize: '1.6em',
paddingBottom: '10px'
}
},
subtitle: {
text: 'Source: Wikipedia.org',
align: 'left',
style: {
color: '#aaa',
fontSize: '1.2em',
fontWeight: 100,
padding: '20px 0'
}
},
xAxis: {
categories: ['Africa', 'America', 'Asia', 'Europe', 'Oceania'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: 'Population (millions)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
},
series: {
pointPadding: 0,
groupPadding: 0.1
}
},
tooltip: { enabled: false },
legend: { enabled: false },
credits: { enabled: false },
series: [{
name: 'Year 1800',
data: [107, 31, 635, 203, 2]
/* {
y: 216.4,
color: '#BF0B23'
} */
}]
});
});