diff --git a/R/apexcharter.R b/R/apexcharter.R index 5325631..4975bb9 100644 --- a/R/apexcharter.R +++ b/R/apexcharter.R @@ -87,13 +87,13 @@ add_locale_apex <- function(widget) { #' @param options_redrawPaths When the chart is re-rendered, #' should it draw from the existing paths or completely redraw #' the chart paths from the beginning. By default, the chart -#' is re-rendered from the existing paths +#' is re-rendered from the existing paths. #' #' @export config_update <- function(series_animate = TRUE, update_options = FALSE, options_animate = TRUE, - options_redrawPaths = FALSE) { + options_redrawPaths = TRUE) { list( series_animate = series_animate, update_options = update_options, diff --git a/inst/htmlwidgets/apexcharter.js b/inst/htmlwidgets/apexcharter.js index f4a319e..648d315 100644 --- a/inst/htmlwidgets/apexcharter.js +++ b/inst/htmlwidgets/apexcharter.js @@ -135,6 +135,21 @@ HTMLWidgets.widget({ if (!axOpts.chart.hasOwnProperty("parentHeightOffset")) { axOpts.chart.parentHeightOffset = 0; } + + // added events to remove minheight container + if (!axOpts.chart.hasOwnProperty("events")) { + axOpts.chart.events = {}; + } + if (!axOpts.chart.events.hasOwnProperty("mounted")) { + axOpts.chart.events.mounted = function(chartContext, config) { + el.style.minHeight = 0; + }; + } + if (!axOpts.chart.events.hasOwnProperty("updated")) { + axOpts.chart.events.updated = function(chartContext, config) { + el.style.minHeight = 0; + }; + } if (x.hasOwnProperty("shinyEvents") & HTMLWidgets.shinyMode) { if (!axOpts.hasOwnProperty("chart")) { @@ -226,8 +241,10 @@ HTMLWidgets.widget({ apexchart.render(); } else { if (x.auto_update) { + //console.log(x.auto_update); apexchart.updateSeries(axOpts.series, x.auto_update.series_animate); if (x.auto_update.update_options) { + delete axOpts.series; apexchart.updateOptions( axOpts, x.auto_update.options_redrawPaths, diff --git a/man/config_update.Rd b/man/config_update.Rd index 4af8909..1f2725d 100644 --- a/man/config_update.Rd +++ b/man/config_update.Rd @@ -8,7 +8,7 @@ config_update( series_animate = TRUE, update_options = FALSE, options_animate = TRUE, - options_redrawPaths = FALSE + options_redrawPaths = TRUE ) } \arguments{