1

已经设法得到一个像下面这样的金字塔图,但是随着百分比数据的变化,金字塔形状会被扭曲。即使百分比数据变化,我也需要保持金字塔形状。jsfiddle在此先感谢

金字塔图

代码:

$('#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]
        }]
    });
4

0 回答 0