2

The highcharts sunburst chart is great, but it doesn't show the dataLabels after you drilldown or drillup

This is the stock example: http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/sunburst/

Notice that once you drilldown to a continent or area, the datalabels disappear. I noticed that there is a note in the github submits, is this fixable? https://github.com/highcharts/highcharts/commit/3ffa39287f4b713517200d7c0b1d498c392c4fba

I can make them re-appear by changing the data source (using setData), but this should happen automatically. I have tried to chart.redraw, as well as the event.drilldown but no joy

series: [{
    type: "sunburst",
    data: data,
    allowDrillToNode: true,
    cursor: 'pointer',
    dataLabels: {
        /**
         * A custom formatter that returns the name only if the inner arc
         * is longer than a certain pixel size, so the shape has place for
         * the label.
         */
        formatter: function () {
            var shape = this.point.node.shapeArgs;

            var innerArcFraction = (shape.end - shape.start) / (2 * Math.PI);
            var perimeter = 2 * Math.PI * shape.innerR;

            var innerArcPixels = innerArcFraction * perimeter;

            if (innerArcPixels > 16) {
                return this.point.name;
            }
        }
  }]
user1758908
  • 146
  • 1
  • 11
  • 1
    You can report it as a bug here: https://github.com/highcharts/highcharts/issues. As for the workaround for now, you can call `setSize` function without arguments on point click event. Example: http://jsfiddle.net/h36L18or/. – pawel_d Oct 27 '17 at 14:50
  • Thanks d_paul so this is forcing the labels to redraw by triggering setSize on the point click event? How would I achieve the same workaround on a drill up? – user1758908 Oct 28 '17 at 16:15
  • apologies @d_paul, the drillup does partially work: if I click on the chart center to drillup the labels are redrawn, but if I click on the drillup box (top right), the labels still don't show – user1758908 Oct 30 '17 at 15:35
  • This is reproducible in Chrome but not Firefox or Safari – Matt Privman Dec 01 '17 at 19:38

0 Answers0