首页 文章

Highcharts中的dash_styles

提问于
浏览
1

我想在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?

1 回答

  • 3

    dash_styles 只是一个辅助函数,显示了您可以使用的破折号类型 .

    检查this example . 您将看到只需要提供破折号类型的名称:

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

    enter image description here

相关问题