Time Series in rHighchart Date Format Matters

I would like to display time series as graphic interactive graphics. However, the following R script does not display dates correctly. The numerical value of the date is reduced after five digits, forcing them to be displayed all at the same day and time. Has anyone experienced and decided something like this?

library(plyr)
library(rCharts)
library(rHighcharts)
cs <-c("13-10-30 12:30:00", "13-10-30 12:35:00", "13-10-30 12:40:00", 
       "13-10-30 12:45:00", "13-10-30 12:50:00", "13-10-30 12:55:00")
x <-strptime(cs, "%y-%m-%d %H:%M:%S")
dfr <-data.frame(date=as.POSIXct(x,origin="1970-01-01"),
                 value=c(1.5,1.25,.75,2.1,1.3,1.4))

hpl <- hPlot(
  value~date,
  data = dfr,
  type = "scatter"
)

hpl$xAxis(type = "datetime")
hpl$chart(zoomType = "x")
hpl$plotOptions(
  line = list(
  marker = list(enabled = F)
 )
)
hpl
+4
source share

All Articles