updateSeries
Updates the series array, overriding the existing data. Supports options for animation, zoom maintenance, and data synchronization with the Gateway.
See updateSeries – ApexCharts Docs for more information.
Overview
Syntax
component.updateSeries(
newSeries,
[animate],
[maintainZoom],
[syncProps],
[fetchResults]
)
Parameters
Type | Parameter | Description |
---|---|---|
List[dict] | newSeries | The new series array to replace the existing one. |
Boolean | animate | Optional. Whether to animate the chart on re-rendering. Default is True. |
Boolean | maintainZoom | Optional. Whether to maintain zoom if the chart is already zoomed in. Default is True. |
Boolean | syncProps | Optional. If True, syncs the updated series with the Gateway's property model via websocket. Default is False. |
Boolean | fetchResults | Optional. If True, sends the series data to the browser via HTTP GET instead of websocket to avoid websocket timeouts. Default is False. |
Returns
None
Examples
Update Series with Sync Props Enabled
self.getSibling("apexchart").updateSeries(
newSeries=[{"data": [32, 44, 31, 41, 22]}],
syncProps=True
)
Update Series without Maintaining Zoom
self.getSibling("apexchart").updateSeries(
newSeries=[{"data": [32, 44, 31, 41, 22]}],
maintainZoom=False
)