How to get series highlight on hover in highcharter?

限于喜欢 提交于 2020-04-14 10:05:40

问题


Highcharts has this neat feature when hovering over a bar in a column chart, the entire series is highlighted, best seen live here:

In the R wrapper highcharter this does not work, why?

library(highcharter)
library(tidyverse)

hc <- highchart() %>% 
  hc_chart(type = "column") %>%
  hc_xAxis(categories = c('Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas')) %>% 
  hc_add_series(name = "John", data = c(5, 3, 4, 7, 2)) %>% 
  hc_add_series(name = "Jane", data = c(2, -2, -3, 2, 1)) %>% 
  hc_add_series(name = "Joe", data = c(3, 4, 4, -2, 5))

hc


回答1:


Because current highcharter uses Highcharts 7.0.1, but this series highlighting (officially called inactive state) exists since Highcharts 7.1.0 version. See the changelog here: https://www.highcharts.com/blog/changelog/#highcharts-v7.1.0




回答2:


You can use the development version from Github and this feature will work for you. The CRAN version is still referring the older version of Highcharts.

devtools::install_github("jbkunst/highcharter")

https://github.com/jbkunst/highcharter



来源:https://stackoverflow.com/questions/56185382/how-to-get-series-highlight-on-hover-in-highcharter

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