我正在尝试创建一个运动折线图。该功能如下所示
library(highcharter)
library(magrittr)
highchart() %>%
hc_chart(type = "line") %>%
hc_yAxis(max = 12, min = 0) %>%
hc_xAxis(categories = c(1, 1.7, 1, 0)) %>%
hc_add_series(data = list(
list(sequence = c(1,1,1,1)),
list(sequence = c(NA,2,2,2)),
list(sequence = c(NA,NA,5,5)),
list(sequence = c(NA,NA,NA,10))
)) %>%
hc_motion(enabled = TRUE, labels = 1:4, series = 0)
但我希望最终结果如下所示,使用该hc_motion
选项
hchart(data.frame(xx=c(1, 1.7, 1, 0), yy=c(1, 2, 5, 10)),
type = "line", hcaes(x = xx, y = yy))
即问题是在第一种情况下,运动图表将其xAxis
视为类别,而我希望它像一个带有直线的散点图。