Point series: Is it possible to join the points with a line?

TeeChart for ActiveX, COM and ASP
Post Reply
TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Point series: Is it possible to join the points with a line?

Post by TonyVSUK » Thu Jul 15, 2010 11:47 am

Point series: Is it possible to join the points with a line?

I cannot seem to find a way to do it (but am sure it must be possible).

Tony.

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

Re: Point series: Is it possible to join the points with a line?

Post by Narcís » Thu Jul 15, 2010 12:18 pm

Hi Tony,

No, you should us a line series and make pointers visible:

Code: Select all

TChart1.Series(0).asLine.Pointer.Visible = True
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

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Point series: Is it possible to join the points with a line?

Post by TonyVSUK » Thu Jul 15, 2010 12:38 pm

I tried that. What I'm trying to show is a kind of flight plan, similar to the attached image.
Attachments
ExcelSample.jpg
ExcelSample.jpg (47.28 KiB) Viewed 9117 times

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

Re: Point series: Is it possible to join the points with a line?

Post by Narcís » Thu Jul 15, 2010 1:22 pm

Hi Tony,

In that case you should use line series with visible pointers and set XValues.Order to none before populating values. By default it's set to ascending.
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

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Point series: Is it possible to join the points with a line?

Post by TonyVSUK » Thu Jul 15, 2010 1:27 pm

I think I've figured out how to set the order.

I've been using AddXY with the line series, should I be using a different function?

The code for testing I have is below. It adds two series, one point, one line. The resultant graph should be identical to the Excel one.

Tony.


TChart1.AddSeries scPoint
TChart1.AddSeries scLine

TChart1.Series(0).Title = "Point Series"
TChart1.Series(1).Title = "Line Series"

TChart1.Series(0).Color = RGB(255, 0, 0)
TChart1.Series(1).Color = RGB(0, 0, 255)

TChart1.Series(0).AddXY 1.66667, 0.132456, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 5.83333, 0.0894737, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 3.64035, 0.17193, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 5.17544, 0.0789474, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 8.07018, 0.141228, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 9.47368, 0.188596, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 7.14912, 0.0517544, "", RGB(255, 0, 0)
TChart1.Series(0).AddXY 1.75439, 0.0789474, "", RGB(255, 0, 0)

TChart1.Series(1).YValues.Order = loNone

TChart1.Series(1).AddXY 1.66667, 0.132456, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 5.83333, 0.0894737, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 3.64035, 0.17193, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 5.17544, 0.0789474, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 8.07018, 0.141228, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 9.47368, 0.188596, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 7.14912, 0.0517544, "", RGB(0, 0, 255)
TChart1.Series(1).AddXY 1.75439, 0.0789474, "", RGB(0, 0, 255)

TonyVSUK
Advanced
Posts: 163
Joined: Wed Mar 01, 2006 12:00 am

Re: Point series: Is it possible to join the points with a line?

Post by TonyVSUK » Thu Jul 15, 2010 1:28 pm

Got it working now. Many thanks. I just needed to set the order to none on both X and Y.

Tony.



TChart1.Series(1).YValues.Order = loNone
TChart1.Series(1).XValues.Order = loNone

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

Re: Point series: Is it possible to join the points with a line?

Post by Narcís » Thu Jul 15, 2010 1:30 pm

Hi Tony,

You're welcome. It's not necessary setting YValues.Order as by default it's none already.
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