Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dygraphs change background colour

Tags:

css

r

dygraphs

how to change the background colour when using the dygraphs in R.

I am looking in the CSS options (https://rstudio.github.io/dygraphs/gallery-css-styling.html) hoping to change the background but can't find anything.

The graph will eventually end up in a shiny dashboard, would I need to change the CSS there instead?

I am hoping to change the background to black.

A reproducible example would be the one provided in the link.

Any suggestions would be greatly appreciated.

Thanks.

like image 278
h.l.m Avatar asked Feb 16 '26 08:02

h.l.m


1 Answers

Just copying my comment, you could use as an alternative:

dygraph(nhtemp, main = "New Haven Temperatures") %>% 
dyShading(from = "1912-1-1", to = "1971-1-1", color = "black")
like image 106
MLavoie Avatar answered Feb 18 '26 22:02

MLavoie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!