如果使用 xAxis 上的多个 y 值,则显示值

show value if multiple y values on xAxis are used

同一个 x 值有多个 y 值,除鼠标悬停外一切正常。使用上面的代码,它只显示一个点的值,而不是每个点的值。我认为他们在这里遇到了类似的问题 https://github.com/highcharts/highcharts/issues/6231

library("highcharter")
df1 <- data.frame(x = c(0,0,1,2,2,3,4),
              y = c(50,100,100,105,150,110,120),
              name = c("A","A","A","A","A","A","A"),
              findNearestPointBy= 'xy')

df2 <- data.frame(x = c(3:6),
              y = c(80,90,98,105),
              name = c("B","B","B","B"),
              findNearestPointBy= 'xy')
series_list <- list(df1, df2)


hc2 <- highchart()
for (k in 1:length(series_list)) {
hc2 <- hc2 %>%
hc_add_series(series_list[[k]])
}
hc2

所以如果光标在 x=0 附近,工具提示总是显示 100 而从不显示 50,如果我的光标接近 50 就不能显示 50 吗?

感谢任何帮助!

我有:

library("highcharter")
df1 <- data.frame(x = c(0,0,1,2,2,3,4),
              y = c(50,100,100,105,150,110,120),
              name = c("A","A","A","A","A","A","A"),
              findNearestPointBy= 'xy')

df2 <- data.frame(x = c(3:6),
              y = c(80,90,98,105),
              name = c("B","B","B","B"),
              findNearestPointBy= 'xy')
series_list <- list(df1, df2)


hc2 <- highchart()%>%
hc_plotOptions(line = list(findNearestPointBy = 'xy'))
for (k in 1:length(series_list)) {
    hc2 <- hc2 %>%
    hc_add_series(series_list[[k]])

}
hc2

也许其他人过去也遇到过同样的问题!