Move Labels on Individual Pie or Donut Slice (HighCharts)

回眸只為那壹抹淺笑 提交于 2019-12-25 09:44:30

问题


I have a pie chart in Highcharts that reduces each slice to create a "fan" effect. Each slice is working great. However, the labels need to be handled as well. I tried the following:

new Highcharts.chart(div, pieOptions,
    function(chartObj) {
        var j = 0;

        $.each(chartObj.series[0].data, function(i, point) {

            point.labelDistance = j;

            j -= 25;

        });

});

This actually updates the label distance properly in the logged out data, but not in the visual itself. I've also tried reloading the chart each time.

Here is a jsfiddle: https://jsfiddle.net/s2pdroze/1/

Summary: I'm looking for each label on each slice to move slight more inward on each iteration.

来源:https://stackoverflow.com/questions/43896672/move-labels-on-individual-pie-or-donut-slice-highcharts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!