This is a migrated thread and some comments may be shown as answers.

redrawChart slow

4 Answers 28 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Veteran
David asked on 02 Nov 2015, 01:28 PM

I have multiple charts in initially hidden iframe, so i forced to redraw them because of ​known issue.

It seems to me that this slows load quite a bit. Is there anything that can improve the situation?

 Here is the code

  var myIframe = $get("<%= ifSummary.ClientID %>");
  myIframe.contentWindow.redrawChart();

function redrawChart() {
               kendo.drawing.util.TextMetrics.current._cache = new kendo.drawing.util.LRUCache(1000);
               $find("<%=rcImpacts.ClientID%>").get_kendoWidget().redraw();
               $find("<%=pieValueAdded.ClientID%>").get_kendoWidget().redraw();
               $find("<%=rchInvestments.ClientID%>").get_kendoWidget().redraw();
               $find("<%=rhcWages.ClientID%>").get_kendoWidget().redraw();
           }

 

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Nov 2015, 11:15 AM

Hi David,

The following article explains how you can improve the performance of a RadHtmlChart control: http://docs.telerik.com/devtools/aspnet-ajax/controls/htmlchart/troubleshooting/performance-optimizations.

Also, I can suggest adding timeouts between the separate redraw() calls so they do not execute immediately one after another.

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
Veteran
answered on 03 Nov 2015, 01:23 PM

Martin,

    I implemented recommendations in the article (which are were appropriate) with limited improvement. I am a little confused by your suggestion of "adding timeouts between the separate redraw() calls". That sounds counter intuitive. Can you elaborate, please? Please include recommended timeout value

0
Marin Bratanov
Telerik team
answered on 03 Nov 2015, 02:02 PM

Hello David,

The idea is to try to distribute the load over more time so the user does not notice it so much. There is no recommended value. Here is something I could start off with:

function redrawChart() {
    kendo.drawing.util.TextMetrics.current._cache = new kendo.drawing.util.LRUCache(1000);
    $find("<%=rcImpacts.ClientID%>").get_kendoWidget().redraw();
    setTimeout(function () {
        $find("<%=pieValueAdded.ClientID%>").get_kendoWidget().redraw();
    }, 200);
    setTimeout(function () {
        $find("<%=rchInvestments.ClientID%>").get_kendoWidget().redraw();
    }, 400);
    setTimeout(function () {
        $find("<%=rhcWages.ClientID%>").get_kendoWidget().redraw();
    }, 600);
}

if this helps, you can refactor it further to match your needs (e.g., reduce or increase the timeouts, make the code better, etc.).

Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
David
Top achievements
Rank 1
Veteran
answered on 03 Nov 2015, 02:31 PM
Thank you
Tags
Chart (HTML5)
Asked by
David
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
David
Top achievements
Rank 1
Veteran
Share this question
or