'How to force redraw ApexCharts?

I'm updating ApexCharts using updateSeries while the chart is hidden using display: none. When the series is being updated I think it is checking the width of the element that it is wrapped in. When hidden, the width is considered 0 and therefore the width of the chart is set to 0. I want to force redraw the chart when it is visible but I found nothing in the docs.

PS: The chart restores to its original size when I resize the window.



Solution 1:[1]

I don't know weather it will be help you or not I have same issue using with apex chart some lables and title was missing but when you resize the window it will automatically redraw the chart because apexchart have this property by default chart: { redrawOnWindowResize: true }

I have try this this put chart render method inside timeout function and it works for me

setTimeout(() => {
            chart.render();
},2000)

In my case, it seems like chart rending before getting style of parent component

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kai - Kazuya Ito