Plotting broken lines

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Plotting broken lines

Post by Maximus » Tue Nov 23, 2004 12:09 pm

Hi, as explained in my previous post, I plot Measurements over Time using a TFastLineSeries. The Measurement (amplitude) is plotted on the Y axis and the Time is plotted on the X axis. The software I'm developing communicates with a hardware device and records information received from the hardware device which is then plotted onto the graph. However, this recording can be switched on and off by the user. Since I can determine when the recording was switched on and off I need to somehow stop plotting the seriesline when recording was switched off, and continue plotting when it is switched on. Is there a way this can be achieved using TChart?

Thx in advance for any advice!

Delphi 7
TeeChart Pro 7

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 23, 2004 3:01 pm

Hi,

you can use similar code like the one exposed in the TeeChart Pro Demo features project under :
All features -> Welcome ! -> Speed -> Fast Delete and Fast Pen

Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Post by Maximus » Tue Nov 23, 2004 6:26 pm

Thx for your response Pep! I do have the compiled Demo for TeeChart 7, but I can't find the source code for it anywhere. I looked under All Downloads as well as Customer downloads. Could you perhaps provide me with the URL to the demo's source code?

Thx for your help!

Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Post by Maximus » Wed Nov 24, 2004 8:33 am

Ok, found it. Previously I only downloaded the TeeChart Pro source package, I didn't know that there's a 16MB installer containing all the rest of the stuff. Sorry, my mistake! :oops: :)

Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Post by Maximus » Wed Nov 24, 2004 11:58 am

I tried deleting the specific points, but TChart reconnects the two points on either side of the deleted point. This is not the result I am looking for. I need to have a gap between 2 or more points. Is this at all possible?

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Nov 24, 2004 12:31 pm

Hi.

Instead of deleting unwanted points, you could also change them to "null" points and create gaps in the line. This can be done on already added points (use SetNull method or set point Color to clnone) or even better, at the time when you're adding points. In this case all you must do is use AddNullXY method to add null point with x value between ending and starting recording time and y value equal to start or end (y) value.
Marjan Slatinek,
http://www.steema.com

Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Post by Maximus » Wed Nov 24, 2004 7:21 pm

Thanks for the help so far. The SetNull and AddNullXY methods were exactly what I was looking for. Unfortunately I ran into another problem. The SetNull and AddNullXY methods only works on TLineSeries and not on TFastLineSeries. I tried using TLineSeries before but because of the amount of data I have to display it simply is too slow to be usefull. The only thing left for me to do is to Add a point directly below the last known recording point at pos Y=0, then add a point below the continuation point at pos y=0 and finally add the continuation point itself. This will in effect cause a U shaped line to be drawn which might look weird but it's the only solution left I guess.

Is there a way for me to develop my own line series class which is inherited from TCustomSeries, impliments all the TFastLineSeries capability, but in addition add the Color property per point so I can set the Color of the point to clNone?

Maximus
Newbie
Newbie
Posts: 8
Joined: Fri Apr 02, 2004 5:00 am

Post by Maximus » Thu Nov 25, 2004 7:45 am

Nevermind, I missed the IgnoreNulls property for TFastLineSeries. It finally works! I am ecstatic! :D

Post Reply