Problems with Series...

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bingo72
Newbie
Newbie
Posts: 42
Joined: Sun Aug 10, 2003 4:00 am
Location: Austria

Problems with Series...

Post by bingo72 » Wed Nov 22, 2006 12:24 pm

http://www.bos.at/downloads/Chart.jpg

Hello Experts!!

I have some troubles with my Series which are shown above...
I capture some SensorData and want to show them on the chart. I capture over 30 secs. but I see only values till approx. 21 secs??!! Where are the remaining values??
I controlled the values before which are added to the chart...yes there are values over 30 secs.

Other questions:
+) Where can I define how many values (secs on the x-axis) I want to see??
+) Is it possible to click on the chart and get back time back of the cursor-position?? For example when the cursor clicks at 3.6 sec of the chart, then I want to get back the time := 3.6 sec.
Excellent it will be when I also get the values of Series1 and Series2 at 3.6!! :)

Bye
Thomas[/url]

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 Nov 22, 2006 12:55 pm

Hi Thomas,
I have some troubles with my Series which are shown above...
I capture some SensorData and want to show them on the chart. I capture over 30 secs. but I see only values till approx. 21 secs??!! Where are the remaining values??
I controlled the values before which are added to the chart...yes there are values over 30 secs.
I can see your problem in the image but we need to reproduce it here to be able to help you. Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can add random data to the project series with a timer or whatever you fell like to imitate the original project behavior.

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
+) Where can I define how many values (secs on the x-axis) I want to see??
Please read Tutorial 4 - Axis Control for this. You'll find the tutorials at TeeChart's program group.
+) Is it possible to click on the chart and get back time back of the cursor-position?? For example when the cursor clicks at 3.6 sec of the chart, then I want to get back the time := 3.6 sec.
Excellent it will be when I also get the values of Series1 and Series2 at 3.6!!
To achieve that you'll need to do something as the interpolating example I posted here.
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

bingo72
Newbie
Newbie
Posts: 42
Joined: Sun Aug 10, 2003 4:00 am
Location: Austria

Post by bingo72 » Thu Nov 23, 2006 6:56 am

Hello Narcis!!

I'm not able to reproduce this phenomenon with random values. When I do this it seems that I got all values in the chat but I can't understand why I have the result with my values.
I'm loading my values from a filestream to a memorystream and from there in the teechart...so I have to get to the bottom of it.

Bye
Thomas

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

Post by Marjan » Thu Nov 23, 2006 7:00 am

Hi, Thomas.

How do you populate the series ? By using AddXY method ? If this is the case, do you clear the series prior to loading data from it? I'd use the following approach:

Code: Select all

Series1.Clear;
// add data by using AddXY method
// series horizontal axis maximum/minumum are
// calculated from XValues maximum and minimum value
Series1.GetHorizAxis.Automatic := True;
Marjan Slatinek,
http://www.steema.com

bingo72
Newbie
Newbie
Posts: 42
Joined: Sun Aug 10, 2003 4:00 am
Location: Austria

Post by bingo72 » Thu Nov 23, 2006 7:26 am

Hello Marjan,

thanks a lot for your fast reply!! Thats excellent support!! :D

First of all I init my Chart on Form Show...

Code: Select all

  displaySensorData.AddSeries(Series1);
  displaySensorData.AddSeries(Series2);
  displaySensorData.BottomAxis.Labels := true;
  displaySensorData.BottomAxis.DateTimeFormat := 'nn:ss';
  displaySensorData.BottomAxis.Increment := DateTimeStep[dtOnesecond]*(ZEITRAUM DIV 4);
  Series1.XValues.DateTime := true;
  Series2.XValues.DateTime := true;
then I clear my Series

Code: Select all

    Series1.Clear;
    Series2.Clear;
When I load my values in the memory-stream than I begin to read the time and the both data...
For explanation: the lElements stores the heap of sensorData (and the values makes sense when I take a measure over approx. 30 secs and I got 277 measure points --> I take a measure point each 0.1 sec.!!)

Code: Select all

for li := 1 to lElements do begin
    fMStream.Read(lTime, SizeOf(lTime));
    fMStream.Read(lAccelX, SizeOf(lAccelX));
    fMStream.Read(lAccelY, SizeOf(lAccelY));
    aSeries1.AddXY(lTime, lAccelX);
    aSeries2.AddXY(lTime, lAccelY);
end;

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

Post by Marjan » Thu Nov 23, 2006 10:09 am

Hi.

The code looks fine to me. Looking at your original chart image it looks to me series x values (lTime values) are fine (minimum 0s, maximum 30s). But I'm not sure about series y values (in your case lAccelX, lAccelY). I'd check if all lAccelX and AccelY values are in the same magnitude and if not, set vertical axis logarithmic scale to true. I'm guessing here, but judging from your image it appears lAccelX and lAccelY values are very close to zero after 21s.
Marjan Slatinek,
http://www.steema.com

bingo72
Newbie
Newbie
Posts: 42
Joined: Sun Aug 10, 2003 4:00 am
Location: Austria

Problem solved!!

Post by bingo72 » Thu Nov 23, 2006 2:36 pm

Hello Marjan again!!

Problem solved....the bug were incorrect data in my filestream!!

Thanks for your input!!

One last question...Narcis wrote above that I find the tutorial 4 at TeeCharts's program group. I don't find such a group at your homepage...can you send me a link??

Bye
Thomas

bingo72
Newbie
Newbie
Posts: 42
Joined: Sun Aug 10, 2003 4:00 am
Location: Austria

Post by bingo72 » Thu Nov 23, 2006 2:42 pm

Stop!!!

I have found it....!!! :lol:

Post Reply