Width of the teechart asp.net control

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
GLE client
Newbie
Newbie
Posts: 9
Joined: Mon Jul 04, 2005 4:00 am
Location: Belgium
Contact:

Width of the teechart asp.net control

Post by GLE client » Sun Jul 10, 2005 4:22 pm

Hi,
I would like to put the webteechart.net V2 component on 100% width of my webform. I readed the help of the teechart's width property that says that you can set a width in percent.
The problem is that when i set 100% in the with propert, the chart takes 100px and not 100%.
Here, you can find some captures:
http://www.oknodata.com/teechart1.jpg
http://www.oknodata.com/teechart2.jpg
http://www.oknodata.com/teechart3.jpg

How can I put my webteechart on 100% width of my client browser.

Thanks...
Bourdon Benoit

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 12, 2005 10:36 am

Hello,

The TeeChart documentation for this property is misleading. Sorry for that, it will be corrected. Percentage was ruled-out as an option due to the following reasons:

The Chart is created as an image at the server and the size needs to be known at that moment to do so. As percentage dimensions are a client variable any subsequent resizing at the client would cause, if the Chart dimensions were to be set as percentage, a distortion of the image as the aspect ratio varies on resize.

To illustrate the limitation you could try the following code, placing it in inside the <head></head> tag of a test webform:

Code: Select all

<script language="jscript" &
    window.onload=windowload;
    window.onresize=windowResize;

    function windowload()
    {
      var obj=document.getElementById('WebChart1');
      obj.style.posWidth=document.body.clientWidth*0.8;
    }
    
    function windowResize()
    {
      var obj=document.getElementById('WebChart1');
      obj.style.posWidth=document.body.clientWidth*0.8;
    }
</script &
Depending on the Chart type you might find the result satisfactory. Please note that we couldn't assure the validity of mouseclicks for postback if the Charts are dynamic in nature.

* Please bear in mind to change "&" in the script openning and closing tags for greater than symbol.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply