Setting border at runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Setting border at runtime

Post by tbonejo » Mon Nov 06, 2006 2:01 pm

How do I set the border at runtime for a chart?

I see nothing in the docs? Seems like that would be in there?


Thanks,

Tom
Tom

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

Post by Narcís » Mon Nov 06, 2006 3:28 pm

Hi Tom,

You can use TChart.Border, for example:

Code: Select all

  With Chart1.Border do
  begin
    Visible:=true;
    Color:=clBlue;
    Width:=5;
  end;
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

tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Post by tbonejo » Mon Nov 06, 2006 3:52 pm

Thanks,

I guess I am not use to using the With statement. I was looking for something like: Chart1.Border := .....but what to put after this is what I was not sure of?
Tom

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

Post by Narcís » Mon Nov 06, 2006 4:20 pm

Hi Tom,

You can not use the with statement if you want. Anyway, you can use a variable of TChartHiddenPen type and use it like this:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var MyBorderPen: TChartHiddenPen;
begin
  MyBorderPen:=TChartHiddenPen.Create(Chart1.CanvasChanged);

  MyBorderPen.Visible:=true;
  MyBorderPen.Color:=clBlue;
  MyBorderPen.Width:=5;

  Chart1.Border:=MyBorderPen;
end;
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