1

如何删除下图中的“系列 2”?该文档指向https://api.highcharts.com/highcharts/plotOptions.flags。但是,我找不到如何将附加选项添加到“...”的示例。

library("quantmod")
library("highcharter")

usdjpy <- getSymbols("USD/JPY", src="oanda", auto.assign = FALSE)

dates <- as.Date(c("2018-01-08", "2018-01-12"), format = "%Y-%m-%d")
highchart(type = "stock") %>% 
  hc_add_series(usdjpy, id = "usdjpy") %>% 
  hc_add_series_flags(dates,
                      title = c("E1", "E2"), 
                      text = c("This is event 1", "This is the event 2"),
                      id = "usdjpy") %>% 
  hc_legend(enabled = T)
4

1 回答 1

4

只需添加参数showInLegend = F

highchart(type = "stock") %>% 
  hc_add_series(usdjpy, id = "usdjpy") %>% 
  hc_add_series_flags(dates,
                      title = c("E1", "E2"), 
                      text = c("This is event 1", "This is the event 2"),
                      id = "usdjpy", showInLegend = F) %>% 
  hc_legend(enabled = T)

欲了解更多信息:https ://api.highcharts.com/highcharts/series.line.showInLegend

于 2018-04-17T17:43:43.257 回答