Facet function in highcharts

拟墨画扇 提交于 2019-12-10 19:33:07

问题


I have a data like this example:

df <-
  data.frame(
    date = seq(as.Date("2015-01-01"), as.Date("2015-12-31"), 100),
    id = rep(LETTERS, each = 4)[1:100],
    replicate(2, sample(1001, 100))
  )

Plotting with ggplot is Ok

ggplot(df, aes(x = date)) +
  geom_line(aes(y = X1)) +
  geom_line(aes(y = X2), linetype = 2) +
  facet_wrap( ~ id , scales = "free") 

I found some info about facet implementation in highchart higcharter-grid-test and I tried to plot it with highchart in order to make an interactive plot, but highchart::hw_grid() and browsable() are deprecated. Can anybody help me with ploting my data?

My snippet :

  highchart() %>% 
    hc_add_series(name = "X1", data = df$X1) %>% 
    hc_add_series(name = "X2", data = df$X2) %>% 
    hw_grid(id, rowheight = 200, ncol = 3)

来源:https://stackoverflow.com/questions/52917106/facet-function-in-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!