How to customize poll pie chart colors?

How can I change the colors in the pie charts being used in polls?

4 likes

It doesn’t look like this was ever answered. I’m looking for this answer, too.

I would also like to adjust colors because the colors are just a gradient and not easy to determine at a glance when there are many choices.

Manually adjusting colors or having them be based on a complementary color pallette or something more distinct for would be beneficial

1 like

I think this is not possible, or at least, I wouldn’t know about it.

The bar chart could be done via CSS, but the pie chart is rendered as an entire canvas, so can’t target any separate HTML.

Your best bet might be to make a feature request, or marketplace topic about this.

1 like

It’s not currently possible, but it is something we’ve done in canvas elements before so we can also make it possible here!

This was just merged

So if you update Discourse a little later today, you’ll have access to some new variables for both bar and pie charts:

:root {
  --poll-pie-color-1: red;
  --poll-pie-color-2: yellow;
  /* --poll-pie-color-3: hotpink; etc */
        
  --poll-bar-background: lightblue;
  --poll-bar-color: blue;
  --poll-bar-color--chosen: salmon;
}