Resize Chart image in RadSplitter

Thread is closed for posting
4 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 06 Jun 2007 Link to this post


    RadControls version
     Web.UI version

    2007 Q1 SP1
    .NET version

    Visual Studio version

    VS2005 SP1
    programming language

      javascript, C#
    browser support

    all browsers supported by RadControls

    To convert code from posted projects Telerik online converter

    Some RadControls like RadGrid automatically resize themselves when placed in RadSplitter or container that has variable height/width. However this does not apply for RadChart as the control renders a normal image on the page, which does not have any dynamic values to resize itself. This how ever can be achieved with the help of some javascript for manually altering the image width/height according to the RadPane's ones. Find attached a project that shows you how to do this.
  2. Lakhani
    Lakhani avatar
    5 posts
    Member since:
    Jun 2012

    Posted 06 Jun 2007 Link to this post

    Thank you very much for your solution, But unfortunately it is not what I wants.

    Since here image will get destorted. Hence I wants to Redraw chart again for the new size. And this can be done only if I can get Serverside event on Pane Resize. Will you tell me how can I get it?


    Anil Lakhani
  3. Steve
    Steve avatar
    10940 posts

    Posted 14 Jun 2007 Link to this post

    Hi Lakhani,

    Sorry for the late reply, but sometimes time just isn't enough for all you want to do. Find attached a new project which shows you how to resize real time (setting the dimensions on the server) with the help of the AjaxManager. I have used the AjaxManager, so the unpleasant postbacks can be avoided.

    I hope this is what you are looking for.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Telerik Admin
    Telerik Admin avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 08 Mar 2008 Link to this post

    Updated versions of the projects are attached to the initial message. Minor changes in the client-side code as follows:

    Client-side resize:
    function ResizeChart(sender, args) 
                    var chart = $get("<%= RadChart1.ClientID %>"); 
                    var chartimg = chart.getElementsByTagName("img")[0]; 
          "width", sender.get_width() + "px"); 
          "height", sender.get_height() + "px"); 

    Server-side resize:
    function ResizeChart_ServerSide(sender, args) 
                    var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>'); 
                    var arg1 = sender.get_width() + "px"
                    var arg2 = sender.get_height() + "px"
                    var arguments = arg1 + "," + arg2; 

    Do not forget to add the chart HTTP handler in web.config.
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.