Created
August 5, 2016 17:48
-
-
Save bearloga/a87ec1e850ee313897b5a3126d131e37 to your computer and use it in GitHub Desktop.
dyEvent Example for https://github.com/rstudio/dygraphs/issues/122
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
--- | |
title: "dyEvent Example" | |
output: | |
html_document: | |
css: style.css | |
--- | |
```{r setup, echo = FALSE, warning = FALSE, message = FALSE} | |
library(xts) | |
library(dygraphs) | |
knitr::opts_chunk$set(echo = FALSE) | |
``` | |
```{r data} | |
example <- xts(data.frame(data = cumsum(rnorm(90))), order.by = seq(Sys.Date() - 90, Sys.Date() - 1, "day")) | |
``` | |
```{r dygraph} | |
dygraph(example, main = "Random Walk") %>% | |
dyCSS("style.css") %>% | |
dyEvent(Sys.Date() - 7, "Last week", color = "white") | |
``` |
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
body { | |
color: white; | |
background-color: black; | |
} | |
.dygraph-title { | |
color: white; | |
font-weight: bold; | |
} | |
.dygraph-axis-label { | |
color: white; | |
} | |
.dygraph-legend { | |
color: black; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment