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!
V8.02 - Problem loading Series Data from Dynamic array
V8.02 - Problem loading Series Data from Dynamic array
Chris Boone
Sperian Instrumentation
Sperian Instrumentation
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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?
Thanks in advance.
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;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |