【问题标题】:dash_styles in HighchartsHighcharts 中的 dash_styles
【发布时间】:2017-11-06 11:57:09
【问题描述】:

我正在尝试更改 Highcharts 中折线图的 dashStyle。

我参考了RDocumentation,第7页,任何地方都没有它的例子。它所说的只是使用dash_styles()

然后我检查了here 并尝试了,但它没有得到我需要的结果。

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)
}

我如何使用这个 dash_style ?

【问题讨论】:

  • 请分享可重现的例子!

标签: r highcharts linechart r-highcharter


【解决方案1】:

dash_styles 只是一个帮助函数,显示您可以使用哪些类型的破折号。

检查this example。你会看到你只需要给出破折号类型的名称:

highchart() %>%
  hc_add_series(data = rnorm(5), dashStyle = "longdash") %>% 
  hc_add_series(data = rnorm(5), dashStyle = "DashDot") 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-08
    • 1970-01-01
    • 1970-01-01
    • 2019-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多