vue3-apexcharts icon indicating copy to clipboard operation
vue3-apexcharts copied to clipboard

Changing type-prop causes error

Open FilNil opened this issue 4 years ago • 2 comments

If i try to change the type of the chart from a bar-chart to a line-chart it causes an error. The error is : "TypeError Cannot read property '_updateOptions' of null"

I used the example from Github

Here is a testcase which gives the error using the example. LInk to sandbox

When pressing update it change the prop-type from "bar" to "line" which will the cause the error.

FilNil avatar Feb 26 '21 08:02 FilNil

Your sandbox seem to work now, but I got the same problem while updating series and type

apexcharts.common.js:14 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'resetSeries')

Apparently there's a race condition if the type changes right after series is updated

IlCallo avatar Aug 05 '23 14:08 IlCallo

Providing the type via options.chart.type seems to avoid the problem, which definitely seems a race condition due to multiple "resetSeries" calls too close to each other in time

IlCallo avatar Aug 05 '23 15:08 IlCallo