fix: incremental chart updates in ApexChart (updateSeries instead of full re-render) (#23) #32

Merged
pitfriedrich merged 1 commits from ai/issue-23-incremental-chart-updates into main 2026-07-28 17:33:21 +00:00

1 Commits

Author SHA1 Message Date
Pit Friedrich 640616c60a fix: update ApexCharts data in place instead of re-rendering (#23)
CI / build-and-test (pull_request) Successful in 2m21s
Every data change went through renderChart, which rebuilt the chart from a
full option set: animations restarted and zoom/selection state was lost.

Add an updateData path that patches the live chart via ApexCharts'
updateSeries (and updateOptions only when categories/labels actually
change), exposed as AxisChart.updateData / PieChart.updateData. Before the
first render there is nothing to patch, so those fall back to setData.
The theme overlay is re-applied to the merged options, so a rebuild after
a detach starts from the patched data.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0124BiJikbhbiEsNfJxdWM69
2026-07-28 19:29:09 +02:00