• Resolved nikuniku9

    (@nikuniku9)


    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,

Viewing 1 replies (of 1 total)
  • Hey @nikuniku9,

    Thank you for using Visualizer and for reaching out to us!

    You can edit the label color by click Edit Chart > Settings > Manual Configuration and add this code:

    {
    "slices": {
    "0": {
    "textStyle": {
    "color": "black"
    }
    }
    }
    }

    You can change the color to suit your needs, as black is just an example.

    Hope this information helps you!

    Kind regards,

    Mara

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.