## Uncomment the next 3 lines to install the developer version of googleVis
# install.packages(c("devtools","RJSONIO", "knitr", "shiny", "httpuv"))
# library(devtools)
# install_github("mages/googleVis")
library(googleVis)
Stock
#         Date  Device  Value          Title                      Annotation
# 1  2008-01-01 Pencils   3000           <NA>                            <NA>
# 2  2008-01-02 Pencils  14045           <NA>                            <NA>
# 3  2008-01-03 Pencils   5502           <NA>                            <NA>
# 4  2008-01-04 Pencils  75284           <NA>                            <NA>
# 5  2008-01-05 Pencils  41476 Bought pencils             Bought 200k pencils
# 6  2008-01-06 Pencils 333222           <NA>                            <NA>
# 7  2008-01-01    Pens  40645           <NA>                            <NA>
# 8  2008-01-02    Pens  20374           <NA>                            <NA>
# 9  2008-01-03    Pens  50766           <NA>                            <NA>
# 10 2008-01-04    Pens  14334   Out of stock Ran out of stock of pens at 4pm
# 11 2008-01-05    Pens  66467           <NA>                            <NA>
# 12 2008-01-06    Pens  39463           <NA>                            <NA>

plot(
  gvisAnnotationChart(Stock, datevar="Date",
                      numvar="Value", idvar="Device",
                      titlevar="Title", annotationvar="Annotation",
                      options=list(
                        width=600, height=350,
                        fill=10, displayExactValues=TRUE,
                        colors="['#0000ff','#00ff00']"),
                      chartid="AnnotationChart"
  )
)