Forum Discussion

Jake_Raz's avatar
07-09-2024
Solved

Hide the leader lines on Pie Charts when displaying Value or Category Labels

In the formatting options for the Pie Chart widget, under the 'Design' tab, you can choose to display various data labels on the chart. If you select either "Value" or "Category" then these will disp...
  • AssafHanina's avatar
    AssafHanina
    07-10-2024

    Hey Jake_Raz ,

    Please try to use the following Widget Script on the Pie Chart to remove the lines while still displaying the values or categories.

     

    widget.on('processresult', function(w, args) {
        args.result.series.forEach(function(series) {
            series.dataLabels = {
                enabled: true,
                connectorWidth: 0,  // Set the width of the line (connector) to 0
                style: {
                    textOutline: 'none'  // Remove text outline if needed
                }
            };
        });
    });

     

    Best Regards