Page 1 of 1

Problems with Series...

Posted: Wed Nov 22, 2006 12:24 pm
by 8577300
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]

Posted: Wed Nov 22, 2006 12:55 pm
by narcis
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.

Posted: Thu Nov 23, 2006 6:56 am
by 8577300
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

Posted: Thu Nov 23, 2006 7:00 am
by Marjan
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;

Posted: Thu Nov 23, 2006 7:26 am
by 8577300
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;

Posted: Thu Nov 23, 2006 10:09 am
by Marjan
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.

Problem solved!!

Posted: Thu Nov 23, 2006 2:36 pm
by 8577300
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

Posted: Thu Nov 23, 2006 2:42 pm
by 8577300
Stop!!!

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