Skip to main content
v2.2

Destroying components

All LightningChart Python components can be permanently destroyed or cleaned with dispose method.

series.dispose()
chart.dispose()
axis.dispose()

When destroying components that can own other components (e.g. series are owned by chart), it is enough to dispose the top level component (e.g. chart)

chart.dispose() # This also disposes all series of the chart

Destroying components is important in applications where charts can be created many times during the application runtime, to avoid memory leaks.

dashboard.dispose()  # Disposes all charts in the dashboard
container.dispose() # Disposes all charts in the container