Starting from the official example for pie chart.
I'm not able the change the legend color.
'legend.textStyle': { 'color': 'gray' }
Is not taken into account.
Please check out the fiddle
Am I doing something wrong ?
How to display both Percentage and Values in Google Pie Chart ? You can't display both on the slice labels, but if you set the pieSliceText option to 'label' and the legend. position option to 'labeled' , you will see the value on the slice and the percent on the legend label.
To hide the legend in Google Chart with JavaScript, we set the legend property to 'none' . const options = { //... legend: "none", }; to set legend to 'none' in the options object to hide the legend.
I wasn't actually able to get your answer to work either. Instead, I used the following:
legend: {textStyle: {color: 'gray'}}
It is
legend: {textStyle: {color: 'gray'}}
instead of
'legend.textStyle': { 'color': 'gray' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With