Hi,
Using TeeChart 7.04 I've created a 1000 points sweepchart which cycles around when at the end of data. In 'RealTime', a point in a serie is replaced.
This works very well, with a total processorload of 0 - 2 % for the whole data acquisition application.
The customer is able to scroll (pan) only vertically in the graph during running. Both the Left (Y) and Bottom (X) axes are fixed scaled, ClipPoints = False and all other tricks for fast graphing are implemented.
However, when the customers scrolls too extensively, firmly holding down the right mouse button and fastmoving of the mouse, the processorloads increases > 90%. This will cause loss of data...
This might be obvious, as you should not hold down the right mousebutton in this way, though I'm not in front of the customer every day.
Is'nt there a flag somewehere wich I could check in the OnAllowScroll event to disable scrolling when a scroll is active? i.e. slowing down the excessive repaints?
Thanks in advance for your support!
Kind regards,
Davy
Scrolling & ProcessorLoad
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Davy,
First of all, please notice that latest TeeChart Pro v7 VCL release available at the client download area is v7.12. You may be interested in using that version and check if it solves the problem at your end.
Alternativelly you can use the OnMouseMove event (or any other mouse event) like this:
First of all, please notice that latest TeeChart Pro v7 VCL release available at the client download area is v7.12. You may be interested in using that version and check if it solves the problem at your end.
Alternativelly you can use the OnMouseMove event (or any other mouse event) like this:
Code: Select all
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if (Shift = Chart1.ScrollMouseButton) then
Chart1.AllowPanning := false
else
Chart1.AllowPanning := true;
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 |
Hi Narcis,
Thanks for your reply.
I assume that this code is the same as you propose:
This code just disable scrolling at all, which is not our goal.
Customer should be able to Pan, but without excessive repaints when holding the R mouse button firmly down while fast moving the mouse.
Kind regards,
Davy.
TeeChart 7.04 & Delphi 7
Thanks for your reply.
I assume that this code is the same as you propose:
Code: Select all
if (ssRight in Shift) then
Chart1.AllowPanning := pmNone
else
Chart1.AllowPanning := pmVertical;
This code just disable scrolling at all, which is not our goal.
Customer should be able to Pan, but without excessive repaints when holding the R mouse button firmly down while fast moving the mouse.
Kind regards,
Davy.
TeeChart 7.04 & Delphi 7
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Davy,
Yes, sorry, my code doesn't even compile .
Latest binary release for Delphi 7 is v7.07 while latest sourcecode version is v7.12. Could you please try if those versions enhance the performance at your end?
Yes, sorry, my code doesn't even compile .
Latest binary release for Delphi 7 is v7.07 while latest sourcecode version is v7.12. Could you please try if those versions enhance the performance at your 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 |
Hi Davy,
Here i can suggest you two possibilities depending on the repaint frequency you wish.
You could disable autorepaint when right mouse button is pressed and only repaint and draw new values when user holds up the right mouse:
And the other possibility is adding a timer and give him a repaint interval:
Here i can suggest you two possibilities depending on the repaint frequency you wish.
You could disable autorepaint when right mouse button is pressed and only repaint and draw new values when user holds up the right mouse:
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = Chart1.ScrollMouseButton then
Chart1.AutoRepaint := false;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = Chart1.ScrollMouseButton then
begin
Chart1.AutoRepaint := true;
Chart1.Repaint;
end;
end;
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = Chart1.ScrollMouseButton then
begin
Chart1.AutoRepaint := false;
Timer1.Enabled := true;
end;
end;
procedure TForm1.Chart1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = Chart1.ScrollMouseButton then
Timer1.Enabled := false;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Chart1.AutoRepaint := true;
Chart1.Repaint;
Chart1.AutoRepaint := false;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Timer1.Interval := 1000;
Timer1.Enabled := false;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Davy,
I'm really glad to see that!
I'm really glad to see that!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |