首页 文章

Highcharts饼图

提问于
浏览
0

我正在寻找类似于此的半饼图:

i.stack.imgur.com/I26zG.png

我'm looking for gauge chart but in this case series don'打印,only print the dial values,并且没有打印乐队

我打算用实时打印plotband . 但在这种情况下,图表api无法更改或我找不到它 .

使用饼图是另一种可能性,但在这种情况下我需要从-90º到90º开始,我没有找到任何使用方法,而且type = pie没有窗格(//api.highcharts.com / highcharts#pane)选项 .

谁能帮我?

2 回答

  • 1

    您可以调用Axis.update()并将其传递给Axis配置设置对象 . 其中一个设置可以是新的plotBands值 . 因此,每次更新仪表值时,都会重置仪表值两侧的plotBands . 您需要调整其他内容以使我的示例看起来就像您的图像 .

    看看这个jsFiddle:http://jsfiddle.net/ZrGut/

    yAxis.update({
        plotBands: [{
            from: 0,
            to: leftVal,
            color: 'pink',
            innerRadius: '100%',
            outerRadius: '0%'
        },{
            from: leftVal,
            to: 90,
            color: 'tan',
            innerRadius: '100%',
            outerRadius: '0%'
        }]
    }, false);
    
  • 1

    终于昨天晚上I found other solution,附上小提琴 . 谢谢你的帮助 .

    plotOptions: {
                pie: {
                    startAngle: 0,
                    allowPointSelect: true,
                    innerSize: '110%',
                    size:'150%',
                    center: [100,200],
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: null,
                        color: '#000000',
                        connectorColor: '#000000',
                        format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                    }
                }
            }
    

相关问题