Question: How can I customize the slice label color in a Pie_Donut Chart?
-
Hi,
When I creating a Pie/Donut Chart using Google Charts API, there is a case where the center of the slice is in the center of the donut when there is only one slice.
In this case, I would like to change the label color of the slice, but there seems to be no item to change the label color in the settings menu (Settings – Slice Settings).To adjust the display when there is only one slice, alternatives include:
- Shift the display position of the label
- Do not display the label
- Cover the donut hole (Pie Hole=0)
- Set in Manual Configuration (e.g.,“slices”:{“0”:{“textStyle”:{“color”: “black”}}})
However, I thought it would be better to change the label color.
I would like to know if there is a way to change the slice label color. If not, I believe it would be a good idea to add an option for this in the settings.
(e.g.,”Slice Label Color” or “Slice Text Color”)After reading the Google Charts API documentation, I found a description that suggests changing the slice text color in such cases:
‘Note that Google Charts tries to place the label as close to the center of the slice as possible. If you have a donut chart with just one slice, the center of the slice may fall into the donut hole. In that case, change the color of the label.’
https://developers.google.com/chart/interactive/docs/gallery/piechart#donut
Thanks,
- You must be logged in to reply to this topic.