Keeping a graph line the same when adding points?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Monkey
Newbie
Newbie
Posts: 12
Joined: Wed Nov 09, 2005 5:00 am

Keeping a graph line the same when adding points?

Post by Monkey » Wed Dec 10, 2008 12:07 pm

Hi Support,

I think I saw a thread on this a few months ago but I can't find it - if it's still around here somewhere then please point me in the right direction :)

I have a system that adds points using X and Y values to a chart at regular intervals. As each point is added, a line must be drawn from the previous point to the current one, without changing the previous lines that have been drawn.

Image

In the above example, Graph A represents the desired behaviour. Graph B is what happens when I try to use a TLineSeries and add the points using the .ADDXY method.

Is there a series (or chart) type that is designed to do this?

Thanks,
Monkey.

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 Dec 10, 2008 12:12 pm

Hi Monkey,

That's because, by default, X values are sorted ascendingly as line series are designed for plotting sequential data. To achieve what you request you can set x values order to none before populating your series:

Code: Select all

  Series1.XValues.Order:=loNone;
Hope this helps!
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

Monkey
Newbie
Newbie
Posts: 12
Joined: Wed Nov 09, 2005 5:00 am

Post by Monkey » Wed Dec 10, 2008 1:06 pm

Hi Narcís,

That does the trick!

Thanks,
Monkey.

wwp3321
Newbie
Newbie
Posts: 60
Joined: Wed Jul 02, 2003 4:00 am

Post by wwp3321 » Wed Dec 17, 2008 6:56 am

Thanks :D

Post Reply