Jaquelline
Posts: 40
Joined: Fri Nov 09, 2018 9:15 am

Variable Pie Annotations / Labels

Hi,

I am trying to work with "type: variablepie". And I have two questions:
1. How can I make use of the
dataLabels
so that I position them NOT in order from the beginning of the chart, but in specific points that I choose.
dataLabels.jpg
dataLabels.jpg (63.95 KiB) Viewed 425 times

2. Can I display more than one variablepie in the same graph, like it is in here with 'pie'?
multipleLayers.jpg
multipleLayers.jpg (42.21 KiB) Viewed 425 times
Many thanks,
Jaquelline
Jaquelline
Posts: 40
Joined: Fri Nov 09, 2018 9:15 am

Re: Variable Pie Annotations / Labels

For the first question I have found the solution (and also for the second one :D):

Code: Select all

 for(i=0; i<120; i++){
pieValues[i] = new Array();
               if(i===0 || i===15 || i===30 || i===45 || i===60 || i===75 || i===90 || i===105){
                pieValues[i] = {
                    y: 5.25,
                    z: curentVal*1.4,
                    color: swicherC,
                    sName : minTol + ' < '+ ScurentVal + ' mm' + ' < ' + maxTol,
                    name : '⦿   ' + ScurentVal,
                    text: i*3 + " º",
                    dataLabels: {
                        distance: 4 ,
                        enabled: true,
                        borderRadius: 5,
                        backgroundColor: 'rgb(255, 255, 204)',
                        borderWidth: 1,
                        borderColor: '#AAA',
                        y: 26// Individual distance
                    }
                }
                
               }else{
                pieValues[i] = {
                    y: 5.25,
                    z: curentVal*1.4,
                    color: swicherC,
                    sName : minTol + ' < '+ ScurentVal + ' mm' + ' < ' + maxTol,
                    text: i*3 + " º",
                }
                }
BUT still ... I want to get rid of the lines that link the pie to the labels. Here is an example .

https://codepen.io/Jaquelline/pen/ZmjNYV?editors=0010#

Thanks,
Jaquelline
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: Variable Pie Annotations / Labels

Hello Jaquelline!

Nice that you found solutions to your issues! :) To get rid of this line you can set their width to 0. API: https://api.highcharts.com/highcharts/p ... ectorWidth and DEMO: http://jsfiddle.net/Bastss/53qopt9h/

Best regards!
Sebastian Wędzel,
Highcharts Developer

Return to “Highcharts Usage”