Web chart Width and Height
Web chart Width and Height
Is there any way to set the width and height in percentages of the page or the html table cell?
Hi Hermes,
you can do :
you can do :
Code: Select all
<form id="Form1" method="post" runat="server">
tchart:WebChart id="WebChart1" style="Z-INDEX: 101; LEFT: 0px;
POSITION: absolute; TOP: 0px" runat="server"
Width="100%" Height="50%" TempChart="File" AutoPostback="False"></tchart:WebChart>
</form>
Pep Jorge
http://support.steema.com
http://support.steema.com
hi pep, your suggestion didn't work in my app. Here is my HTML tag, notice that the chart is in a table cell and is there where i want the chart was maximized.
<TR>
<TD align="left" width="100%" colSpan="3" height="40%">
<tchart:WebChart id="WebChart1" runat="server" Height="100%" Width="100%" TempChart="Session" AutoPostback="True">
</tchart:WebChart>
</TD>
</TR>
with this tag the width and height are assumed in pixels and if the style option is added the picture is stretched to the cell size.
I test in a separated app with no table and the result is the same.
<TR>
<TD align="left" width="100%" colSpan="3" height="40%">
<tchart:WebChart id="WebChart1" runat="server" Height="100%" Width="100%" TempChart="Session" AutoPostback="True">
</tchart:WebChart>
</TD>
</TR>
with this tag the width and height are assumed in pixels and if the style option is added the picture is stretched to the cell size.
I test in a separated app with no table and the result is the same.
Hi Hermes,
Percentage for a WebForm placed Chart is not difficult to implement at a basic level, the actual sizing of a Chart on the browser (eg. set to 80% or 100%), however there is a sticking point from a design point of view with the use of percentages to define Chart dimensions on a WebForm page:
- The actual pixel dimension of the Chart according to the actual browser page or frame size is not known until the Chart is rendered, that means that the aspect ratio of the Chart is unknown at Chart creation time with the result that it is created serverside with only partial dimensional information and will need to be 'stretched' to fit the percentage adjusted page location. The effect of the stretch on the Chart, that may contain text, may be an impairing of the precision and clarity of the original Chart. Also if the browser is subsequently drag resized by the user the Chart will continuously adjust its size and shape, the result of which is a further re-stretching of Chart contents.
- With the previous point in mind, Chart click events from the client would not be useable as the actual location of components within the Chart will not represent their 'intended' location.
The above are limitations due to the fact that the Chart is rendered as an image on the Web Form. The limitation does not exist for the current TeeChart ActiveX version when rendered on the page as an <object> as all calculation and processing occurs at the client (ie. where all the rendering information is available). It is possible that in a later version of
TeeChart for .NET, by embedding the TeeChart.dll on the page, similar funcionality may be achieved but that is not expected to be a feature of TeeChart for .NET v1.
Percentage for a WebForm placed Chart is not difficult to implement at a basic level, the actual sizing of a Chart on the browser (eg. set to 80% or 100%), however there is a sticking point from a design point of view with the use of percentages to define Chart dimensions on a WebForm page:
- The actual pixel dimension of the Chart according to the actual browser page or frame size is not known until the Chart is rendered, that means that the aspect ratio of the Chart is unknown at Chart creation time with the result that it is created serverside with only partial dimensional information and will need to be 'stretched' to fit the percentage adjusted page location. The effect of the stretch on the Chart, that may contain text, may be an impairing of the precision and clarity of the original Chart. Also if the browser is subsequently drag resized by the user the Chart will continuously adjust its size and shape, the result of which is a further re-stretching of Chart contents.
- With the previous point in mind, Chart click events from the client would not be useable as the actual location of components within the Chart will not represent their 'intended' location.
The above are limitations due to the fact that the Chart is rendered as an image on the Web Form. The limitation does not exist for the current TeeChart ActiveX version when rendered on the page as an <object> as all calculation and processing occurs at the client (ie. where all the rendering information is available). It is possible that in a later version of
TeeChart for .NET, by embedding the TeeChart.dll on the page, similar funcionality may be achieved but that is not expected to be a feature of TeeChart for .NET v1.
Pep Jorge
http://support.steema.com
http://support.steema.com