与highcharts的金字塔图表

时间:2013-06-14 09:36:51

标签: highcharts

设法得到像下面这样的金字塔图表,但随着百分比数据的变化,金字塔形状会变形。即使百分比数据变化,我也需要保持金字塔形状。 jsfiddle提前致谢

pyramid chart

代码:

$('#container').highcharts({
        chart: {
            type: 'area'
        },
        title: {
            text: 'Pyramid Chart'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: ['1', '2', '3', '4','5','6','7','8','9','10','11'],
            tickmarkPlacement: 'off',
            title: {
                enabled: false
            }
        },
        yAxis: {
            title: {
                text: 'Percentage'
            },
            labels: {
                formatter: function() {
                    return this.value;
                }
            }
        },
        tooltip: {
            valueSuffix: ' millions'
        },
        plotOptions: {
            area: {
                lineColor: '#666666',
                lineWidth: 1,
                marker: {
                    enabled: false
                }
            }
        },
        series: [{
            name: 'A',
            zInxed:555555,
            data: [null,null,null,null,80,100,80,null,null,null,null]
            },
            {
            name: 'B',
            zInxed:666666,
            data: [null,null,null,60,80,80,80,60,null,null,null]
            },
            {
            name: 'C',
            zInxed:777777,
            data: [null,null,40,60,60,60,60,60,40,null,null]
            },
            {
            name: 'D',
            zInxed:888888,
            data: [null,20,40,40,40,40,40,40,40,20,null]
            },
            {
            name: 'E',
            zInxed:999999,
            data: [0,20,20,20,20,20,20,20,20,20,0]
        }]
    });

0 个答案:

没有答案