Search code examples
cssrflexdashboard

Change text color in gauge R


I have the follow rmarkdown file:

---
title: Gauge
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
    theme: yeti
---

### Probability
```{r}
library(flexdashboard)

gauge(
   value = 56, min = 1, max = 100, symbol = "%", 
   gaugeSectors(colors = c("#008cba")), label = "Index"
)
 ```

How edit:

56%, 1, 100 and Index

with CSS?

I tried change the follow element into <style> ... </style>:

.chart-wrapper {
  background-color: #222c3d; /*change background-color. Work*/
  color: yellow !important; /*change text color. Doesn't work*/
}

to change the color to yellow. But without success.


Solution

  • Add the following to your CSS:

    text {
      fill: yellow !important;
    }
    ``