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

Charts inside <td> : Empty Space

1 Answer 62 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Karthikeyan
Top achievements
Rank 1
Karthikeyan asked on 01 Mar 2012, 03:38 PM

Hi,

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,

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 06 Mar 2012, 12:11 PM
Hello,

The RadChart in asp.net 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.
Tags
Chart (Obsolete)
Asked by
Karthikeyan
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or