如何删除下图中的“系列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)
答案 0 :(得分:1)
只需添加参数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