Page 1 of 1

Intraweb 8 and TChart Pro

Posted: Mon Aug 28, 2006 9:07 pm
by 9337315
In IWCompTeeChart.pas (which I believe compiles to make the IWChart compiled component) the following code (and comment) exists. I have
TChart 7 pro. Projects work OK when just using fpicture.assign(tmp).
However, when I follow the suggestion in the comment and change this to do a picture.assign(FChart) I get an exception and a Parent form does not exist error.
So, what is the meaning of the comment below? Is there any advantage to being able to assign FChart instead of a bitmap?

Function TIWChart.RenderHTML(AContext:
TIWBaseHTMLComponentContext):TIWHTMLTag;
var tmp : TBitmap;
begin
if Assigned(FChart) then
with FChart do
begin
FPicture.Bitmap.Width:=Width;
FPicture.Bitmap.Height:=Height;
tmp:=TeeCreateBitmap(Color,Rect(0,0,Width,Height));
try
// For compatibility with TeeChart Standard.
// With TeeChart Pro, simple FPicture.Assign(FChart), no bitmap
needed.
FPicture.Assign(tmp);

finally
tmp.Free;
end;
end;

result:=inherited RenderHTML(AContext);
end;

Posted: Tue Aug 29, 2006 8:20 am
by narcis
Hi WCantrall,

To assign a chart why aren't you using the IWChart compiled component? There are examples of its usage included.

Posted: Tue Aug 29, 2006 2:44 pm
by 9337315
The point is that I am using IWChart. The question has to do with the comments in the code that make up IWChart which suggest that the code should be changed for my environment. That source code was provided with IWChart. I have provided the text of the code and the comment. It presumably comes from Steema. Could someone please explain it.

Posted: Fri Sep 01, 2006 2:13 pm
by narcis
Hi WCantrall,

Using the commented code you could improve the performance because the Bitmap wouldn't be calculated twice. For this not to crash you could try creating an invisible form and set it as the parent for FChart that has no parent.

Anyway, we are going to improve this code for future releases.