Intraweb 8 and TChart Pro

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
WCantrall
Newbie
Newbie
Posts: 27
Joined: Mon May 03, 2004 4:00 am
Location: USA
Contact:

Intraweb 8 and TChart Pro

Post by WCantrall » Mon Aug 28, 2006 9:07 pm

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;

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 Aug 29, 2006 8:20 am

Hi WCantrall,

To assign a chart why aren't you using the IWChart compiled component? There are examples of its usage included.
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

WCantrall
Newbie
Newbie
Posts: 27
Joined: Mon May 03, 2004 4:00 am
Location: USA
Contact:

Post by WCantrall » Tue Aug 29, 2006 2:44 pm

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.

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

Post by Narcís » Fri Sep 01, 2006 2:13 pm

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.
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