TeePreviewPanel rectangle

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
amih
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

TeePreviewPanel rectangle

Post by amih » Mon Jan 29, 2007 8:14 am

Hello,

I need some help with TeePreviewPanel component. When I put at design time such a component on a form, inside the panel of he component will be drawn a rectangle which will contain all the charts added to the component. Please let me know how could I make invisible this rectangle or at least change it color (is black by default). If I print TeePreviewPanel through metafile, this rectangle will be print on the paper around the charts and I want to make it invisible.

Another question is about a title/foot for TeePreviewPanel, has anyone a suggestion how can I implement it? I tried TeePreviewPanel->Title but I don't see it displayed on the component.

Thank you in advance.

Best regards,

Mihael Avram

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Jan 29, 2007 10:58 am

Hello amih,

You can try the following code to save a metafile without paper line margins:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  TeePreviewPanel1.Panels.Add(Chart1);
  TeePreviewPanel1.Margins.Visible := false;
  TeePreviewPanel1.SaveToMetafile('C:\temp\MyMetaFile.emf');
end;
And there's no Title nor Foot for TeePreviewPanel but you can edit Chart's ones by:

Code: Select all

Chart1.Title.Text.Clear;
Chart1.Foot.Text.Clear;
Chart1.Title.Text.Add('My Title Chart');
Chart1.Foot.Text.Add('My Foot Chart');
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

amih
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

TeePreviewPanel rectangle

Post by amih » Fri Feb 09, 2007 9:30 am

Thank you for your support.

The line:

Code: Select all

TeePreviewPanel1.Margins.Visible := false; 
doesn't work for me. I mean when I put at design time a TeePreviewPanel component on a form without any chart added to it, there is a rectangle drawn inside the panel and I don't want to print that rectangle on the paper, or at least to change its color if it's possible. It's not about the margins of the chart too.
In order to extent the graphics printed on the paper, I used negative numbers like in this example (for portrait):

Code: Select all

TMetafile * tmpMeta = new TMetafile;
  tmpMeta = TeePreviewPanel1->TeeCreateMetafile(true,
     Rect(TeePreviewPanel1->ClientRect.Left,
     TeePreviewPanel1->ClientRect.Top,TeePreviewPanel1->ClientRect.Right,
     TeePreviewPanel1->ClientRect.Bottom));
Printer()->Canvas->StretchDraw(Rect(-50,-600,Printer()->PageWidth+600, Printer()->PageHeight+600),tmpMeta);

// and here I implemented a title for the  page:

Printer()->Canvas->Font->Assign(titleEdit->Font);
int titleLeft = (Printer()->PageWidth - Printer()->Canvas->TextWidth(titleEdit->Text)) / 2;

Printer()->Canvas->TextOut(titleLeft, 10, titleEdit->Text);


but I want to disable the print of the rectangle I mentioned above. Any solution?

My best regards
Mihael Avram

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Feb 09, 2007 10:28 am

Hi amih,

Using TeeChart v7.07 the next line of code works fine for us:

Code: Select all

TeePreviewPanel1->Margins->Visible = false;
If it still doesn't solve your problem, tell us what version are you using and we'll look for another solutions.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply