primaires démocrates

by v_schmitt57_laposte_net

HTML

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

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

JavaScript

$(function () {
    $('#container').highcharts({
        title: {
            text: 'Intentions de vote des primaires démocrates',
            x: -20 //center
        },
        subtitle: {
            text: 'Sources: YouGov/Economist & Ipsos/Reuters',
            x: -20
        },
        xAxis: {
            categories: ['Jan 2015', 'Fév', 'Mar', 'Avr', 'Mai', 'Jun', 'Jui', 'Aoû', 'Sep', 'Oct', 'Nov', 'Déc']
        },
        yAxis: {
            title: {
                text: 'Pourcentage',
                x: -0
            }
        },
        tooltip: {
            pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b> ({point.y:,.0f} millions)<br/>',
            shared: true
        },
        tooltip: {
            valueSuffix: ' %'
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: [{
            name: 'Hillary Clinton',
            data: [61, 68, 61, 71, 60, 62, 56, 55, 46, 51]
        }, {
            name: 'Bernie Sanders',
            data: [3, 8, 8, 7, 12, 16, 18, 18, 25, 24],
            marker: {
                symbol: 'circle'
            },
        }, {
            name: 'Joe Biden',
            data: [7, 12, 9, 7, 11, 13, 13, 11, 18, 16],
            marker: {
                symbol: 'circle'
            },
        }, {
            name: 'Autres',
            data: [20, 7, 11, 7, 6, 3, 7, 6, 3, 3],
            marker: {
                symbol: 'square'
            },
            color: '#ABAAAA'
        }, {
            name: 'Indécis',
            data: [9, 5, 11, 8, 11, 6, 6, 10, 8, 6],
            marker: {
                symbol: 'square'
            },
            color: '#C80B0B',
        }]
    });
});