【发布时间】:2021-12-18 05:51:30
【问题描述】:
我无法让误差线正确覆盖在我的分组列图上。在 ggplot 中我会使用 position = position_dodge(),但我无法在 highcharts 的错误栏文档中找到类似的内容。
这是一个 MWE:
df <- data.frame(Gender = c("Male", "Male", "Female", "Female"),
ShareType = rep(c("Long", "Short"),2),
InvestedPerAccount = c(10,9,7,8),
lower = c(8,7,6,7),
upper = c(11.5,10,9,8.8))
highchart() %>%
hc_add_series(df, "column",hcaes(x = ShareType, y = InvestedPerAccount, group = Gender),
tooltip = list(enabled = TRUE,pointFormat = '${point.y}')) %>%
hc_add_series(df, 'errorbar', hcaes(x = ShareType, low = lower, high = upper, group = Gender, grouping = FALSE)) %>%
hc_xAxis(categories = df$ShareType, title = list(text = "Share Type")) %>%
hc_colors(c("pink","lightblue"))
【问题讨论】:
-
似乎是 github 上的一个未解决问题:github.com/jbkunst/highcharter/issues/513
标签: r ggplot2 highcharts data-visualization r-highcharter