redrawChart slow

5 posts, 0 answers
  1. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 02 Nov 2015 Link to this post

    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();
               }

     

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 03 Nov 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 03 Nov 2015 in reply to Marin Bratanov Link to this post

    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

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 03 Nov 2015 Link to this post

    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
  6. David
    David avatar
    159 posts
    Member since:
    Mar 2014

    Posted 03 Nov 2015 in reply to Marin Bratanov Link to this post

    Thank you
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017