dhi*_*nar 3 r linechart highcharts r-highcharter
我正在尝试更改 Highcharts 中折线图的 dashStyle。
我参考了RDocumentation,第 7 页,在任何地方都没有它的例子。它所说的只是使用dash_styles()
然后我在这里检查并尝试过,但它并没有导致我需要的东西。
library(highcharter)
highchart() %>%
hc_title(text = title) %>%
hc_xAxis(categories = batchno) %>%
hc_add_series(name = "Mixer A", data = A,
color = "hotpink", pointWidth = 20, type = "line",
dash_styles(style = "LongDot")) %>%
hc_add_series(name = "Mixer B" , data = B,
color = "slateblue", pointWidth = 20,type = "line") %>%
hc_chart(type = "column") %>%
hc_yAxis(
list(lineWidth = 3, lineColor='seashell', title=list(text= "text"),max= 10)) %>% hc_tooltip(crosshairs = TRUE, shared = TRUE)
}
Run Code Online (Sandbox Code Playgroud)
我如何使用这个 dash_style ?
dash_styles 只是一个辅助函数,显示您可以使用哪种类型的破折号。
检查这个例子。你会看到你只需要给出破折号类型的名称:
highchart() %>%
hc_add_series(data = rnorm(5), dashStyle = "longdash") %>%
hc_add_series(data = rnorm(5), dashStyle = "DashDot")
Run Code Online (Sandbox Code Playgroud)