0

I'm trying to create a polar column chart. This chart has to show a stacked column. this was simple but the real thing is I'm getting the x-axis & labels for the polar chart outside the chart at its circumference, but I want them to be inside at the center. Is it achievable ?

Thanks for your time

4

2 回答 2

1

这不是直接支持的,但可以实现。

我们需要为那个创建一个额外的假序列和轴。然后使用偏移我们可以将主轴移动到中心。最后一件事是计算 yAxis 的最小值,以确保列不会从内部开始。

$('#container').highcharts({
    series: [{
        data: [12,13,14,15,5,17]  
    }, {
        data: [13,15,4,12,14,16]   
    }, {
        data: [1,15,13,4,14,16]   
    },{
        data: [13,15,3,12,1,16]   
    },  {
        data: [null,null,null,null,null,null],
        xAxis: 1
    }],
    chart: {
        polar: true,
        type: 'column'
    },

    xAxis: [{
        offset: 120,
        tickInterval: 1,
        tickmarkPlacement: 'on'
    }, {
        lineWidth: 0,
        tickInterval: 1,
        labels: {
            enabled: false
        }
    }],

    yAxis: {
        min: -35,
        endOnTick: false,
        showLastLabel: true,
        title: {
            text: null
        },
        labels: {
            align: 'center',
            formatter: function () {
                if(this.value >= 0 ){
                    return this.value + '%';
                } else {
                    return '';
                }
            }
        }
    },
    plotOptions: {
        series: {
            stacking: 'normal',
        }
    }
});

给你的例子:http: //jsfiddle.net/QgUgW/4/

于 2013-04-25T13:01:46.437 回答
0

您可以使用偏移属性:http ://api.highcharts.com/highcharts#xAxis.offset

但这会导致图表混乱。极坐标图通常很混乱,因为它是..

于 2013-04-24T15:48:00.590 回答