apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.18k stars 1.29k forks source link

toggleDataPointSelection causes error in pie chart #1464

Closed vitalcrazz closed 4 years ago

vitalcrazz commented 4 years ago

Bug report

toggleDataPointSelection causes error in a pie chart in latest 3.18.0 version while in 3.17 version it works just fine.

Codepen

https://codesandbox.io/s/vue-basic-example-5t1jf

Explanation

I'm using a donut chart and I call toggleDataPointSelection(0) method a long time after the chart is loaded (after user clicks a button). I get the following error and a donut piece is disappearing instead of selecting. <path> attribute d: Expected number, "M NaN NaN A NaN Na…".

vitalcrazz commented 4 years ago

2 1 3

junedchhipa commented 4 years ago

Thanks for reporting, the issue will be addressed soon.

poddarkhushbu07 commented 3 years ago

What is the cause of this error. I am also getting the same issue.

neozhu commented 2 years ago

me too, use mudcharts in blazor server

image
DasunMuthuruwan commented 2 years ago

Any update on this? I'm facing this issue too

khoanld-2442 commented 2 years ago

Hí anh em

Mominjon commented 2 years ago

image

is there any fix for this i am having big problems

AlexParton commented 1 year ago

I have solved all those errors by destroying the chart when component unmounts. I did it on Sveltekit, and there the chart needs to be rendered inside the onMount method and binding the html container element with bind:this to avoid another annoying error (window is not defined), and to be able to identify the chart inside the onDestroy method a callback function needs to be created where the chart is rendered (onMount). So the workaround gets like this:

` let graphContainer: HTMLElement; let destroyer: any;

onMount(async () => { const ApexCharts = (await import('apexcharts')).default const container = graphContainer; const chart = new ApexCharts( container, setOptions(pairData)) chart.render(); destroyer = () => chart.destroy() })

onDestroy(async () => { destroyer() }) `

Rao-Mudasir commented 1 year ago

any fix