Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container" style="height: 400px"></div>

JavaScript

$(function () {
        $('#container').highcharts({
            chart: {
                type: 'bar'
            },       
        credits: {
            enabled: false
        },
            title: {
                text: ''
            },
            xAxis: {		    
				labels: {
                enabled: false
            },
                categories: ['']
            },
            yAxis: {
		    labels: {
                enabled: true
            },
                min: 0,
                title: {
                    text: ''
                }
            },
            legend: {
                backgroundColor: '#FFFFFF',
                reversed: true,
                align: 'bottom',
                verticalAlign: 'bottom',
                x: 0,
                y: 100
            },
            tooltip: {
                enabled: false
            },
            plotOptions: {
                series: {   
				 minPointLength: 3,            
				 dataLabels: {
					color: 'white',
                    align: 'center',
                    enabled: true,
                    format: '{y} %'
                  },
                    stacking: 'percent'
                 },
                bar: {
			   events: {
					legendItemClick: function () {
					   vote(1,this.userOptions.id);
					   return false; 
						}
					}
				,
				showInLegend: true
			   }
            },
                series: [
				 				 {
                name: 'yes',
                data: [{ y : 73.91, id : '1' }],
                id: '1'
            },
				 				 {
                name: 'no',
                data: [{ y : 26.09, id : '2' }],
                id: '2'
            },
				 ]
        });
    });