4

I'd like to display a time series as a highchart interactive graphic. However, in the following R scrip the dates are not displayed correctly all. The numerical value for the date is cut after five digits, making them appear all on the same day and time. Anyone experienced and solved something similar?

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
B-leR
  • 428
  • 4
  • 7
  • Can you install the `dev` version using `devtools::install_github('rCharts', 'ramnathv', ref = 'dev')`. I just pushed a patch that corrects how dates are handled in `highcharts`. On a related note, you don't need `rHighchart`, since the functionality of that package has been folded into `rCharts`. – Ramnath Nov 04 '13 at 15:11

0 Answers0