简体   繁体   中英

How to remove "Values" from R Highcharter

highchart() %>% 
  hc_yAxis_multiples(
    list(lineWidth = 3),
    list(showLastLabel = FALSE, opposite = TRUE),
    list(title = list(text = "<b>Sepal Length<b>",margin = 20),opposite = FALSE),
    list(title = list(text = "<b>Petal Length<b>", margin = 20), opposite = TRUE)
  ) %>% 
  hc_xAxis(categories = iris$Species) %>%
  hc_add_series(name = "Sepal Length", data = iris$Sepal.Length,type="column", yAxis=0, color ="#ff9400") %>% 
  hc_add_series(name = "Petal Length", data = iris$Petal.Length, type="column", yAxis=1, color ="#7fadf0")

I'm using hc_yAxis_multiples to add an additional Y-axis. I'd like to remove the text label "Values" on both sides of the Y-axis.

I found a similar post about this problem: How to remove "Values" and "series" from highcharts? , but it's in Java and the example has only one Y-axis.

Try this one :

highchart() %>% 
  hc_yAxis_multiples(
    list(title=list(text="<b>Sepal Length<b>",margin = 20),
         lineWidth = 3,showLastLabel = FALSE,opposite = FALSE),
    list(
      title=list(text="<b>Petal Length<b>", margin = 20),
      lineWidth = 3,showLastLabel = FALSE,  opposite = T)
  ) %>% 
  hc_xAxis(categories = iris$Species) %>%
  hc_add_series(name = "Sepal Length", data = iris$Sepal.Length,type="column", yAxis=0, color ="#ff9400") %>% 
  hc_add_series(name = "Petal Length", data = iris$Petal.Length, type="column", yAxis=1, color ="#7fadf0")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM