We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Render Chart on Dashboard layout resize

Hi,


In the SEO Analysis Dashboard, you have multiple charts in the dashboard layout, once the user resizes the dashboard, automatically the chart is re-rendering with the new size, I was not able to find what property or function doing this, can you help

https://ej2.syncfusion.com/demos/#/bootstrap5/dashboard-layout/analytics-dashboard.html


1 Reply

DG Durga Gopalakrishnan Syncfusion Team December 1, 2022 02:41 PM UTC

Hi Abdul,


Greetings from Syncfusion.


We suggest you to call the chart refresh method in dashboard layout resizeStop event to re-render the chart while resizing the panel. Please check with the below snippet and API reference link.


<ejs-dashboardlayout (resizeStop)='onPanelResize($event)'>

      //…

       <ejs-chart #chart></ejs-chart>

     //…

</ejs-dashboardlayout>

 

@ViewChild("chart")

public chart: ChartComponent;

function onPanelResize(args) {

            this.chart.height = '100%';

            this.chart.width = '100%';

            this.chart.refresh();

    }


API Reference : https://ej2.syncfusion.com/angular/documentation/api/dashboard-layout/#resizestop


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Live Chat Icon For mobile
Up arrow icon