highcharts柱状图(堆叠图与多个柱图)、条形图(堆叠图与多组条形)

利用highcharts的

series: {

                stacking: 'normal'

            }

进行区分。

$(function () {

    $('#container').highcharts({

        chart: {

            type: 'bar'

        },

        title: {

            text: 'Stacked bar chart'

        },

        xAxis: {

            categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']

        },

        yAxis: {

            min: 0,

            title: {

                text: 'Total fruit consumption'

            }

        },

        legend: {

            backgroundColor: '#FFFFFF',

            reversed: true

        },

        plotOptions: {

            series: {

                stacking: 'normal'

            }

        },

        series: [{

            name: 'John',

            data: [5, 3, 4, 7, 2]

        }, {

            name: 'Jane',

            data: [2, 2, 3, 2, 1]

        }, {

            name: 'Joe',

            data: [3, 4, 4, 2, 5]

        }]

    });

});



你可能感兴趣的:(Highcharts)