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")
我hc_yAxis_multiples
用来添加其他Y轴。我想删除Y轴两侧的文本标签“值”。
我发现了与此问题类似的帖子:如何从highcharts中删除“值”和“系列”?,但是它使用Java,该示例只有一个Y轴。
试试这个:
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")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句