Highcharts - 按类别堆叠的列

时间:2014-01-28 09:33:37

标签: javascript highcharts multiple-columns stacked-chart

我有这些数据:

Array
(
    [firefox 3.0] => 2
    [chrome 24.0] => 1
    [ie 9.0] => 2
    [ie 10.0] => 1
)

问题:如何添加系列来实现想要的图表?

我的尝试:

JsFiddle: http://jsfiddle.net/fVrbQ

我希望像这样叠加图表:

chart

1 个答案:

答案 0 :(得分:0)

您可以为列设置x:http://jsfiddle.net/fVrbQ/1/

 series: [{
            name: 'firefox 3.0',
            data: [[0,2]],
            stack:0
        }, {
            name: 'chrome 24.0',
            data: [[1,1]],
            stack:1
        }, {
            name: 'ie 9.0',
            data: [[2,2]],
            stack:2
        }, {
            name: 'ie 10.0',
            data: [[2,1]],
            stack:2
        }]