Charts inside <td> : Empty Space

Thread is closed for posting
2 posts, 0 answers
  1. Karthikeyan
    Karthikeyan avatar
    5 posts
    Member since:
    Jun 2012

    Posted 01 Mar 2012 Link to this post


    I have set the (Height,width) as (250px,340px) to the radchart.This radchart is placed inside a <td> of a normal html table. I have never set a div around the radchart. But still its showing a <div> with fixed (H,W) as (300px,400px) as in the attached image. Because of this auto-div and its (H,W) settings, there is a space inside this <td> as shown in the image. Please tell me how can I remove this space and make the chart to fit in the <td> exactly.

    Thanks in advance,

  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 06 Mar 2012 Link to this post


    The RadChart in ajax is being rendered as an image and sent to the client. That means that when the browser gets a simple image with size 250x340 (as you have set it). There is no way that the server can know what is the size of this td while it is rendering the chart, that is, before the html has been sent to the client.

    However, there is a way that you can achieve this - when the page has loaded on the client machine you can measure the td and do a postback to get the server to render a new image with the new size. You can see how this can be done here - one of our code libraries. I have also attached a simpler project that resizes the chart after the initial load, however, we generally suggest using the approach with the ajax manager.  

    All the best,
    Petar Marchev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top