Ce n’est pas possible actuellement, mais c’est quelque chose que nous avons déjà fait dans les éléments canvas, nous pouvons donc le rendre possible ici aussi !
Ceci vient d’être fusionné
main ← feature-pie-chart-colors
opened 08:18PM - 05 Dec 25 UTC
This introduces the ability to customize the colors used within pie charts for p… olls. Admins and theme developers can now override the colors using CSS custom properties. I've also added specific properties to make targeting bar charts a little simpler too.
If only some pie chart colors are overridden, we fall back to our default color gradients.
Here's an example
```css
:root {
--poll-pie-color-1: red;
--poll-pie-color-2: yellow;
--poll-bar-background: lightblue;
--poll-bar-color: blue;
--poll-bar-color--chosen: salmon;
}
```
<img width="1446" height="794" alt="image" src="https://github.com/user-attachments/assets/d5a4731d-b7eb-4069-9a0d-c35c9e56518b" />
<img width="1424" height="766" alt="image" src="https://github.com/user-attachments/assets/b30d337e-f714-499b-b48f-ecb9e6e728d7" />
Included a test for the pie chart colors.
Donc, si vous mettez à jour Discourse un peu plus tard aujourd’hui, vous aurez accès à de nouvelles variables pour les graphiques à barres et les graphiques en secteurs :
: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;
}
4 « J'aime »