Page 1 of 1

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

Posted: Thu Jul 15, 2010 11:47 am
by 9530487
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.

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

Posted: Thu Jul 15, 2010 12:18 pm
by narcis
Hi Tony,

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

Code: Select all

TChart1.Series(0).asLine.Pointer.Visible = True

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

Posted: Thu Jul 15, 2010 12:38 pm
by 9530487
I tried that. What I'm trying to show is a kind of flight plan, similar to the attached image.

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

Posted: Thu Jul 15, 2010 1:22 pm
by narcis
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.

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

Posted: Thu Jul 15, 2010 1:27 pm
by 9530487
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)

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

Posted: Thu Jul 15, 2010 1:28 pm
by 9530487
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

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

Posted: Thu Jul 15, 2010 1:30 pm
by narcis
Hi Tony,

You're welcome. It's not necessary setting YValues.Order as by default it's none already.