Joe W
Joe W

Reputation: 2891

Highcharts server side export Pie With Data Labels (phantomjs)

I am trying to export a Pie chart with data labels. I'm using the Phantomjs server side export functionality. I get the chart image back correctly but the datalabels don't show up. The sample data structure in the web version adds the data labels as expected.

Is there specific configuration requited to get the data labels to show up? I'm on HIghcharts 4.0.1

The JSON I'm sending over to the phantom server is:

{"infile":"{ legend: {enabled: false},chart: {borderWidth: 0},colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'],credits: {text:'CannLabs'},title: {text: 'Potency results'},plotOptions: {pie: {dataLabels: {enabled: true,color: 'black',format: '<b>{point.name}</b>: {point.percentage:.1f} %'}}},series: [{type: 'pie',name: 'Potency Results',data: [{name: 'CBD-V', y: 0.00},{name:'CBD-A',y: 0.00},{name:'CBG',y: 0.00},{name:'CBD',y: 0.01},{name:'THC-V',y: 0.00},{name:'CBN',y: 0.01},{name:'THC',y: 0.87},{name:'CBC',y: 0.02},{name:'THC-A',y: 0.00}]}]};"}

Upvotes: 0

Views: 825

Answers (2)

Kosta Kontos
Kosta Kontos

Reputation: 4322

If the accepted answer above doesn't help you, try adding animation: false to your series configuration, like so:

plotOptions: {
    series: {
        animation: false
    }
},

Upvotes: 2

Joe W
Joe W

Reputation: 2891

This appears to be a bug in the 4.0.1 version of highcharts. I upgraded to the master version of the highcharts.js file and the labels are now rendered correctly.

Upvotes: 2

Related Questions