fixed resizing bug with auto update + dont update synced charts options

This commit is contained in:
pvictor 2020-04-15 16:20:29 +02:00
parent ea901187ac
commit 02cf03fd6a
3 changed files with 16 additions and 5 deletions

View File

@ -88,17 +88,21 @@ add_locale_apex <- function(widget) {
#' 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.
#' @param update_synced_charts All the charts in a group should
#' also update when one chart in a group is updated.
#'
#' @export
config_update <- function(series_animate = TRUE,
update_options = FALSE,
options_animate = TRUE,
options_redrawPaths = TRUE) {
options_redrawPaths = TRUE,
update_synced_charts = FALSE) {
list(
series_animate = series_animate,
update_options = update_options,
options_animate = options_animate,
options_redrawPaths = options_redrawPaths
options_redrawPaths = options_redrawPaths,
update_synced_charts = update_synced_charts
)
}

View File

@ -245,10 +245,13 @@ HTMLWidgets.widget({
apexchart.updateSeries(axOpts.series, x.auto_update.series_animate);
if (x.auto_update.update_options) {
delete axOpts.series;
delete axOpts.chart.width;
delete axOpts.chart.height;
apexchart.updateOptions(
axOpts,
x.auto_update.options_redrawPaths,
x.auto_update.options_animate
x.auto_update.options_animate,
x.auto_update.update_synced_charts
);
}
} else {

View File

@ -8,7 +8,8 @@ config_update(
series_animate = TRUE,
update_options = FALSE,
options_animate = TRUE,
options_redrawPaths = TRUE
options_redrawPaths = TRUE,
update_synced_charts = FALSE
)
}
\arguments{
@ -21,7 +22,10 @@ config_update(
\item{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.}
\item{update_synced_charts}{All the charts in a group should
also update when one chart in a group is updated.}
}
\description{
Configuration for auto update