cancel
Showing results for 
Search instead for 
Did you mean: 

Pie Chart Value label color

rahuldhomane
9 - Travel Pro
9 - Travel Pro

Hi ,

Is there a way to change the color of value labels in a pie chart? 

Thanks

1 ACCEPTED SOLUTION

harikm007
12 - Data Integration
12 - Data Integration

@rahuldhomane ,

Previous script is to change color of outer labels (I thought requirement is to change color of labels outside piechart). 

If you are trying to change colors of labels inside piechart (in your screenshot 43%, 40%, 12%, 5%), try this script:

 

widget.on('domready', function(se, ev){
	$('piechart .pie-percent-label').css('fill', 'green')
})

 

Result will looks like: 

harikm007_0-1645681502448.png

 

-Hari

View solution in original post

3 REPLIES 3

harikm007
12 - Data Integration
12 - Data Integration

@rahuldhomane ,

If you are looking for applying same color for all value labels, try this script:

widget.on('processresult', function(se, ev){
	ev.result.plotOptions.pie.dataLabels.color = 'red'
})

harikm007_0-1645643426723.png

-Hari

 

Hi Hari,

Thanks for your help, but the isn't working for percentage value label. Please find the image for your reference

harikm007
12 - Data Integration
12 - Data Integration

@rahuldhomane ,

Previous script is to change color of outer labels (I thought requirement is to change color of labels outside piechart). 

If you are trying to change colors of labels inside piechart (in your screenshot 43%, 40%, 12%, 5%), try this script:

 

widget.on('domready', function(se, ev){
	$('piechart .pie-percent-label').css('fill', 'green')
})

 

Result will looks like: 

harikm007_0-1645681502448.png

 

-Hari