Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dash_styles in Highcharts

I am trying to change the dashStyle of a Line chart in Highcharts.

I referred to RDocumentation , page 7, There is no example of it anywhere. All it says is use dash_styles()

Then i checked here and tried, but it is not resulting in what i need.

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

How do i use this dash_style ?

like image 758
dhinar1991 Avatar asked Nov 20 '25 05:11

dhinar1991


1 Answers

dash_styles is only a helper function show what types of dash you can use.

Check this example. You'll see you need only give the name of the type of dash:

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

enter image description here

like image 128
jbkunst Avatar answered Nov 22 '25 18:11

jbkunst



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!