cancel
Showing results for 
Search instead for 
Did you mean: 

Pie Chart Value label color

rahuldhomane
10 - ETL
10 - ETL

Hi ,

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

Thanks

1 ACCEPTED SOLUTION

@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

6 REPLIES 6

harikm007
13 - Data Warehouse
13 - Data Warehouse

@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

@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

Hari,

I'm attempting to change the font weight of pie dataLabels and not having luck.  Can you point out what is wrong with my script?  Thanks, - Dennis

widget.on('processresult', function(se, ev){
ev.result.plotOptions.pie.dataLabels.style.fontWeight = "bold"
})

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @Dennis_M ,

Try this script

widget.on('processresult', function(se, ev){
	ev.result.plotOptions.series.dataLabels.style = {fontWeight:'bold'}
})

-Hari

Thanks Hari for assisting me on the fontWeight .  Java/CSS is still very new to me.  - D