Created
December 21, 2014 21:33
-
-
Save timelyportfolio/cf7b94048ffe7b6a0112 to your computer and use it in GitHub Desktop.
htmlwidgets dygraphs only show highlighted legend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dygraphs) | |
lungDeaths <- cbind(ldeaths, mdeaths, fdeaths) | |
dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)") %>% | |
dyHighlight(highlightSeriesOpts = list(strokeWidth = 3)) -> d1 | |
#this is a hack to set css directly | |
# dyCSS designed to read a text css file | |
d1$x$css = " | |
.dygraph-legend > span {display:none;} | |
.dygraph-legend > span.highlight { display: inline; } | |
" | |
d1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is so awesome. Thanks so much. This is exactly what I was looking for.