Election Poll Difference
http://flowingdata.com/2012/10/11/not-enough-donut/
by jlbriggs
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<div id="container" style="height:250px;width:400px"></div>
JavaScript
var chart = new Highcharts.Chart({
chart: {
renderTo:'container',
type:'column',
marginBottom:70
},
title:{
text:'Election Poll - Gallup vs Pew'
},
credits:{enabled:false},
legend:{
y:10
},
plotOptions: {
series: {
marker:{
symbol:'circle',
radius:8,
},
shadow:false,
borderWidth:0,
dataLabels:{
enabled:true,
formatter:function(){
return '<span>'+ this.y + '</span>%';
}
}
}
},
xAxis:{
categories:['Gallup', 'Pew'],
lineColor:'#999',
lineWidth:1,
tickColor:'#666',
tickLength:3,
title:{
text:''
},
labels:{
y:25,
style:{
fontWeight:'bold',
fontSize:'14px',
color:'#666',
fontFamily:'helvetica, sans-serif'
}
}
},
yAxis:{
endOnTick:false,
lineColor:'#999',
lineWidth:1,
tickColor:'#666',
tickWidth:1,
tickLength:3,
gridLineColor:'#ddd',
title:{
text:'',
rotation:0,
margin:50,
}
},
series: [{
name:'Obama',
color:'#69c',
data: [
{x:0,y:49,poll:'Gallup'},
{x:1,y:45,poll:'Pew'}
]
},{
name:'Romney',
color:'#c00',
data: [
{x:0,y:46,poll:'Gallup'},
{x:1,y:49,poll:'Pew'}
]
}]
});