Page 1 of 1

V8.02 - Problem loading Series Data from Dynamic array

Posted: Wed Feb 27, 2008 10:00 pm
by 10548367
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!

Posted: Thu Feb 28, 2008 8:33 am
by narcis
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.

Posted: Thu Apr 10, 2008 8:12 pm
by 10548367
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

Posted: Fri Apr 11, 2008 11:18 am
by narcis
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.