How do you refresh the accumulation charts that belong to the accordion?

Hi.


I created an accordion consisting of five contents. The content includes a chart. The problem is that when the page is first loaded, only items with the 'expanded' attribute 'true' are successfully charted and other charts are generated abnormally.


I tried to attach the video, but it didn't work, so I'll send it to you by e-mail. I would appreciate it if you could check and reply.


1 Reply

DG Durga Gopalakrishnan Syncfusion Team April 6, 2022 01:42 PM UTC

Hi TaeWook,


Greetings from Syncfusion.


We suggest you to use accordion expanded event to refresh the chart control while expanding the accordion items. We have prepared sample based on your requirement. Please check with the below snippet and sample.


<ejs-accordion id="defaultAccordion" expanded="onExpanded">

</ejs-accordion>

<script>

    function onExpanded(args) {

        if (args.index == 0) {

            var pieObj1 = document.getElementById('Chart1').ej2_instances[0];

            pieObj1.refresh();

        }

        else if (args.index == 2) {

            var pieObj2 = document.getElementById('Chart2').ej2_instances[0];

            pieObj2.refresh();

        }

    }

</script>



Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/AccordionChart-1486736081.zip


Events : https://ej2.syncfusion.com/documentation/api/accordion/#events


Please revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon