dreamRs / apexcharter

:bar_chart: R Htmlwidget for ApexCharts.js
https://dreamrs.github.io/apexcharter
Other
138 stars 15 forks source link

ax_forecast_data_points() seems to be missing #70

Closed franolicr closed 1 year ago

franolicr commented 1 year ago

There doesn't seem to be an ax_forecast_data_points() function that corresponds to the forecastDataPoints option (https://apexcharts.com/docs/options/forecastdatapoints/)

pvictor commented 1 year ago

Hello, indeed, there's one if you re-install from GitHub. An example:

# add 5 predictions to data then plot it
data.frame(
  time = seq_len(53),
  lh = c(
    as.vector(lh),
    as.vector(predict(arima(lh, order = c(1,0,1)), 5)$pred)
  )
) %>% 
  apex(aes(time, lh), type = "line") %>% 
  ax_xaxis(type = "numeric") %>% 
  ax_forecast_data_points(count = 5)

image

pvictor commented 1 year ago

Available in the last CRAN version