V8.02 - Problem loading Series Data from Dynamic array

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Booner12
Newbie
Newbie
Posts: 3
Joined: Mon Feb 18, 2008 12:00 am
Location: Middletown, CT USA
Contact:

V8.02 - Problem loading Series Data from Dynamic array

Post by Booner12 » Wed Feb 27, 2008 10:00 pm

I am having a problem loading the series with data from 2 dynamic array in Delphi 7. The X axis is filled with time array and the second contains floating point values

The arrays are filled starting at element zero and dimensioned to size of the dataset. My application will freeze after the arrays are loaded.

If I dimension the arrays with an extra element it works, but the value of this element is zero. The code is as follows:

NumOfPts:=length(pSesTime);
{ set our X array }
With serMax.XValues do
begin
Value:=TChartValues(pSesTime); { <-- the array }
Count:=NumOfPts; { <-- number of points }
Modified:=True; { <-- recalculate min and max }
end;

{ set our Y array }
With serMax.YValues do
begin
Value:=TChartValues(pGraph[GraphNum].Max);
Count:=NumOfPts;
Modified:=True;
end;

chtSesData.UndoZoom; { <-- remove zoom (optional) }

{ Show data }
serMax.Repaint;


What am I doing wrong? I have also tried using the AddXY method with the same results. Please help!
Chris Boone
Sperian Instrumentation

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 28, 2008 8:33 am

Hi Chris,

Your code looks fine to me. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
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

Booner12
Newbie
Newbie
Posts: 3
Joined: Mon Feb 18, 2008 12:00 am
Location: Middletown, CT USA
Contact:

Post by Booner12 » Thu Apr 10, 2008 8:12 pm

Posting sample code is difficult because the data is retrieved from a database. I have done some more testing and this is what I found:

My Data: The chart is supposed to represent sensor values logged over time. The Y-axis is made up of doubles representing Date and Time. When these values approach 39000 (and past) my application will freeze. Sometimes it is immediate and sometimes it is after zooming on the right portion of the chart. The DateTime format is 'm/d/yy'

If I change the DateTime format for Y-axis to any other format, it works.
This maybe a bug you want to look into.

Thanks for your time.

Chris Boone
Sperian Instrumentation

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 11, 2008 11:18 am

Hi Chris,

Thanks for the information but I'm not able to reproduce the problem here using the code below. Does it work fine at your end? Could you please modify it or let us know the exact steps we should follow to reproduce the problem here?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Series1.YValues.DateTime:=true;

  for i:=0 to 40000 do
    Series1.Add(i);

  Chart1.Axes.Left.DateTimeFormat:='m/d/yy';
end;
Thanks in advance.
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

Post Reply