Open queimadus opened 4 years ago
I ran into the same issue on v0.7.20, except it wasn't just quick consecutive calls that didn't work; even after many seconds had passed, a call to update with a new set of regions wouldn't cause any changes.
It seems that regions must be removed before updating (otherwise nothing changes). I had to use with chart.regions.remove()
instead of chart.regions([])
to accomplish this.
Additionally, because .remove()
animates by default, I had to use chart.regions.remove({'duration' : 0})
Modified example fiddle w/ workaround: https://jsfiddle.net/z7f8b9La/
Quick consecutive calls to
chart.regions(newRegions)
do not update the chart. Even calls spaced by 1 second do not work as expected.In this example (https://jsfiddle.net/La5mfg67/) we do the following sequence:
region1
. ✅[]
. ❌region2
. ❌region3
. ❌[]
. ✅region4
. ✅region5
. ❌I was expecting:
region2
(with maybe some flashing?)region3
no regions
region4
region5