Deprecated Highcharter feature release differs from proposed

I am creating a time series plot with highcharter

Josh Kunst's excellent library at R.

Using this data:

    > dput(t)
structure(c(2, 2, 267822980, 325286564, 66697091, 239352431, 
94380295, 1, 126621669, 158555699, 32951026, 23, 108000151, 132505189, 
29587564, 120381505, 25106680, 117506099, 22868767, 115940080, 
22878163, 119286731, 22881061), .Dim = c(23L, 1L), index = structure(c(1490990400, 
1490994000, 1490997600, 1491001200, 1491004800, 1491008400, 1491012000, 
1491026400, 1491033600, 1491037200, 1491040800, 1491058800, 1491062400, 
1491066000, 1491069600, 1491073200, 1491076800, 1491109200, 1491112800, 
1491120000, 1491123600, 1491156000, 1491159600), tzone = "US/Mountain", tclass = c("POSIXct", 
"POSIXt")), class = c("xts", "zoo"), .indexCLASS = c("POSIXct", 
"POSIXt"), tclass = c("POSIXct", "POSIXt"), .indexTZ = "US/Mountain", tzone = "US/Mountain", .CLASS = "double", .Dimnames = list(
    NULL, "count"))

      

I can make this graph

enter image description here

from

highcharter::highchart() %>% hc_add_series_xts(t)

But I am getting this warning:

'hc_add_series_xts' is deprecated.
Use 'hc_add_series' instead.

      

So, being a simple type, I do exactly this and

highcharter::highchart() %>% hc_add_series(t)  %>% hc_xAxis(type = 'datetime')

      

I am making this graph:

enter image description here

The problem is that I really like that little A- dygraph

line box and slider at the bottom of the first graph, not to mention that it orients the labels on the right y-axis, etc.

Aside from "please don't condemn this function", how can I conclude that the second conclusion - using the suggested and soon, it seems, only function - looks like the first?

+3


source to share


1 answer


The graph you want is of the "stock" type and not the default "chart" (think "Highcharts" vs. "Highstock").

Specifying the type of solution to the problem:



highchart(type = 'stock') %>% 
    hc_add_series(t) %>% 
    hc_xAxis(type = 'datetime')

      

enter image description here

+2


source







All Articles