如何在highcharter中复制轴

时间:2017-09-28 02:20:25

标签: r r-highcharter

如何复制我的x轴(在type='bar'中变为y?)所以我在顶部和底部都有它们?

示例:

library(dplyr)
library(ggplot2)
library(highcharter)
mpgg <- mpg %>% 
  filter(class %in% c("suv", "compact", "midsize")) %>% 
  add_row(manufacturer="loner",class="newClass")%>%
  group_by(class, manufacturer) %>% 
  summarize(count = n())

categories_grouped <- mpgg %>% 
  group_by(name = class) %>% 
  do(categories = .$manufacturer) %>% 
  list_parse()

highchart() %>% 
  hc_xAxis(categories = categories_grouped) %>% 
  hc_add_series(data = mpgg, type = "bar", hcaes(y = count, color = manufacturer),
                showInLegend = FALSE)

enter image description here

0 个答案:

没有答案