TChart Canvas: Adding a line with an arrow

TeeChart for ActiveX, COM and ASP
Post Reply
nbp
Newbie
Newbie
Posts: 15
Joined: Fri Apr 01, 2016 12:00 am

TChart Canvas: Adding a line with an arrow

Post by nbp » Tue Oct 18, 2016 9:32 pm

Is there a method to add a line with an arrow to the TChart Canvas? I'm adding a line with the Canvas.MoveTo() and Canvas.LineTo() calls but how do I add a line with an arrow?

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

Re: TChart Canvas: Adding a line with an arrow

Post by Yeray » Wed Oct 19, 2016 9:54 am

Hello,

TeeChart includes an Arrow Series. You can add arrows with it using axis values (instead of using pixel values).
Ie:

Code: Select all

  TChart1.AddSeries scBar
  TChart1.Series(0).FillSampleValues 5
  TChart1.Series(0).ColorEachPoint = True
  
  TChart1.AddSeries scArrow
  TChart1.Series(1).ColorEachPoint = True
  TChart1.Series(1).asArrow.ArrowHeight = 10
  TChart1.Series(1).asArrow.ArrowWidth = 10
  With TChart1.Series(0)
    For i = 0 To .Count - 2
      TChart1.Series(1).asArrow.AddArrow .XValues.Value(i), .YValues.Value(i) / 2, .XValues.Value(i + 1), .YValues.Value(i + 1) / 2, "", clTeeColor
    Next i
  End With
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