## Please note that by default the googleVis plot command
## will open a browser window and requires Flash and Internet
## connection to display the visualisation.
data(Stock)
Stock
A1 <- gvisAnnotatedTimeLine(Stock, datevar="Date",
numvar="Value", idvar="Device",
titlevar="Title", annotationvar="Annotation",
options=list(displayAnnotations=TRUE,
legendPosition='newRow',
width="600px", height="350px")
)
plot(A1)
## Two Y-axis
A2 <- gvisAnnotatedTimeLine(Stock, datevar="Date",
numvar="Value", idvar="Device",
titlevar="Title", annotationvar="Annotation",
options=list(displayAnnotations=TRUE,
width="600px", height="350px", scaleColumns='[0,1]',
scaleType='allmaximized')
)
plot(A2)
## Colouring the area below the lines to create an area chart
A3 <- gvisAnnotatedTimeLine(Stock, datevar="Date",
numvar="Value", idvar="Device",
titlevar="Title", annotationvar="Annotation",
options=list(
width="600px", height="350px",
fill=10, displayExactValues=TRUE,
colors="['#0000ff','#00ff00']")
)
plot(A3)
## Data with POSIXct datetime variable
A4 <- gvisAnnotatedTimeLine(Andrew, datevar="Date/Time UTC",
numvar="Pressure_mb",
options=list(scaleType='maximized',
width="600px", height="350px")
)
plot(A4)
Run the code above in your browser using DataLab