Arrows on Axis

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

Arrows on Axis

Post by BernardLimont » Wed Jul 13, 2005 8:18 am

Hi,

TChart 6.01
I want to have arrows on the end of the axis.
It is possible ? How to do it ?

Kind regards,
Bernard

PS : In French
Comment faire pour avoir des flèches sur l'extrémité des axes ?
Merci beaucoup
Bernard

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

Post by Narcís » Wed Jul 13, 2005 9:07 am

Hi Bernard,

It's pretty easy, you just need to use AxisArrows tool. You'll find an example of that at TeeChart features demo, available at TeeChart program group. The example is "All Features -> Welcome! -> Tools -> Axis arrows".
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

BernardLimont
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by BernardLimont » Thu Oct 20, 2005 7:18 am

Hi,

Thanks for your answer
I have arrows at the end of each axis.
I want to have it visible but not Active (a click on the arrow don't move the points)
Kind regards,
Bernard

In French :
Merci pour la réponse.
J'ai réussi (depuis longtemps) à avoir les flèches au bout des axes.
Je veux voir ces flèches et empêcher qu'un clic sur la flèche ne déplace les points.
Merci
Bernard

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

Post by Narcís » Thu Oct 20, 2005 8:02 am

Hi Bernard,

I'm afraid there is some kind of incompatibility when setting tool not being active but visible. Could you please be more specific on a case where would you need that approach to see if we can help you finding a solution?
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

BernardLimont
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by BernardLimont » Thu Oct 20, 2005 12:13 pm

Hi Narcis,

I want just to have arrows at the end of each axis.
We make this arrows at school in France in Physics (or math)
Thanks
Bernard

In French :
Je souhaite avoir simplement des flèches à la fin de chaque axes comme on fait en classe dans les cours de Physique ou de math
Merci
Bernard

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

Post by Narcís » Thu Oct 20, 2005 2:40 pm

Hi Bernard,

Then you'd better custom draw the arrows on TChart's canvas doing something like the code below in the OnAfterDraw event:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var
  LU0,LU1,LD0,LD1,BL0,BL1,BR0,BR1: TPoint;
  ArrowLength, ArrowWidth, ArrowHeight, Z: Integer;
  FillArrows: Boolean;
begin
  FillArrows:=true;
  ArrowLength:=20;
  ArrowWidth:=10;
  ArrowHeight:=10;
  Z:=0;

  With Chart1.Axes do
  begin
    //Left Axis UP Arrow
    LU0.X:=Left.PosAxis;
    LU0.Y:=Left.IStartPos+ArrowLength;
    LU1.X:=Left.PosAxis;
    LU1.Y:=Left.IStartPos;

    //Left Axis Down Arrow
    LD0.X:=Left.PosAxis;
    LD0.Y:=Left.IEndPos-ArrowLength;
    LD1.X:=Left.PosAxis;
    LD1.Y:=Left.IEndPos;

    //Bottom Axis Left Arrow
    BL0.X:=Bottom.IStartPos+ArrowLength;
    BL0.Y:=Bottom.PosAxis;
    BL1.X:=Bottom.IStartPos;
    BL1.Y:=Bottom.PosAxis;

    //Bottom Axis Right Arrow
    BR0.X:=Bottom.IEndPos-ArrowLength;
    BR0.Y:=Bottom.PosAxis;
    BR1.X:=Bottom.IEndPos;
    BR1.Y:=Bottom.PosAxis;
  end;

  With Chart1.Canvas do
  begin
    //Arrow(Filled: Boolean; Const FromPoint, ToPoint: TPoint; ArrowWidth, ArrowHeight, Z: Integer);
    Arrow(FillArrows, LU0, LU1, ArrowWidth, ArrowHeight, Z);
    Arrow(FillArrows, LD0, LD1, ArrowWidth, ArrowHeight, Z);

    Brush.Color:=clBlack;

    Arrow(FillArrows, BL0, BL1, ArrowWidth, ArrowHeight, Z);
    Arrow(FillArrows, BR0, BR1, ArrowWidth, ArrowHeight, Z);
  end;
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

BernardLimont
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by BernardLimont » Thu Oct 20, 2005 3:34 pm

Thanks Narcis,

It is what I want to have
Bernard

In French :
Merci beaucoup, c'est tout à fait ce que je souhaite

Post Reply