Highcharts: Is it possible to show Sunburst chart series data labels outside the leaf level nodes with connectors?

可紊 提交于 2019-12-25 00:15:02

问题


Currently, it is observed that all series data labels when shown, overlap or only the show/hide behaviour of data labels can be achieved through the formatter function. Its observed that connectors for series data labels of leaf level nodes or the position of series data labels outside are not configurable.

Refer the following JS Fiddle: http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/sunburst

dataLabels: {
        format: '{point.name}',
        filter: {
            property: 'innerArcLength',
            operator: '>',
            value: 16
        }
    }

Refer the Sunburst chart's series data labels on the following link:- http://www.dundas.com/support/blog/sunburst-charts-homerun-or-groundout

Expected behaviour is to configure the series data labels in such a way that if the arc size of a node is less than a particular value, instead of hiding the data label, show it outside the leaf level nodes of the chart, also adjust the distance of data labels and its connectors from the chart. I would like to show series data labels similar to the Sunburst chart shown in above link. Is there any way to achieve this in Highcharts Sunburst chart?


回答1:


Currently sunburst doesn't support data labels with connectors.

Share the idea of adding them to Highcharts here if you like: https://highcharts.uservoice.com/forums/55896-highcharts-javascript-api

You can create your own connectors functionality using SVGRenderer (first check whether the label appeared or not and draw a connector if needed) or you can try to adjust the functionality implemented for pie series to your case (overwriting sunburst core functions).


API reference: https://api.highcharts.com/class-reference/Highcharts.SVGRenderer

Code reference: https://github.com/highcharts/highcharts/blob/master/js/parts/PieSeries.js

Docs reference: https://www.highcharts.com/docs/extending-highcharts/extending-highcharts



来源:https://stackoverflow.com/questions/47181306/highcharts-is-it-possible-to-show-sunburst-chart-series-data-labels-outside-the

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