updateCharts redraws a chart or a single layer of a chart to make it up
to date with the current state of the environment variables.
ID of the chart to be updated (or vector of IDs). If
ID of the layer to be updated (or vector of IDs). If
To improve performance it may be useful to change only certain
aspects of a chart (e.g. positions of points, colour of heatmap cells,
etc.). This argument can specify which part of chart to update. Possible options are
Linked charts of the rlc package are based on the idea that the variables that are
used to define a chart are not constant, but can change as a result of user's
actions. Each time the
updateCharts function is called, all the properties that were set inside
dat function are re-evaluated and the chart is redrawn in accordance with the
If this function is called from the R session, changes will be applied
to all currently opened pages. If it is used as a part of any
rlc callback, only the page
that triggered the call will be affected.
This function is a wrapper around method
updateCharts of class
To improve performance you can update only a certain part of a chart (e.g. colours,
size, etc.). This can be done by setting the
updateOnly argument. Here are all
possible values for this argument.
These are valid for all the charts:
Size changes the size of the chart (and consequently position
of all its elements).
Title changes the title of the chart.
Canvas If number of elements is too high the
charts switch to the canvas mode and instead of multiple SVG point or cells
a single Canvas image is generated. This type of update redraws the Canvas
image. It is not recommended to use this option, since it will be used automatically when necessary.
These can be updated only in heatmaps (
Labels adds new row and column labels and removes those that are no longer
needed. Also updates
Cells adds new cells and removes those that are no longer needed.
Texts if necessary.
Texts adds or remove text inside cells where needed.
LabelPosition updates coordinates of all existing row and column labels.
CellPosition updates coordinates of all existing cells. Also
TextPosition if necessary.
LabelText updates text of all existing labels.
CellColour updates colour of all existing cells. Also
TextValues if necessary.
TextValues updates text inside cells to make it up to date with current
These aspects are present in all the charts with axes.
Axes updates axes of a chart and changes position
of its elements (points, lines, etc.) accordingly.
Elements updates (add or removes) all the elements of the layer.
ElementPosition updates positions of all the elements in the layer.
ElementStyle updates the style (colour, opacity, etc.) of all the elements
of the layer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
data(iris) #store some properties in global variables width <- 300 height <- 300 colour <- iris$Sepal.Width #create a chart lc_scatter(dat(x = iris$Sepal.Length, y = iris$Petal.Length, colourValue = colour, width = width, height = height), chartId = "iris") #change the variables height <- 400 colour <- iris$Petal.Width #this will change colour of points and chart height updateCharts("iris") #this will change only height updateCharts("iris", updateOnly = "Size") #add another property setProperties(dat(symbolValue = iris$Species), "iris") #this will change only colour and symbols updateCharts("iris", updateOnly = "ElementStyle")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.