TScrollpagerTool - Can I delay repainting of the main chart?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jens.mertelmeyer
Newbie
Newbie
Posts: 60
Joined: Fri Nov 22, 2013 12:00 am

TScrollpagerTool - Can I delay repainting of the main chart?

Post by jens.mertelmeyer » Mon Nov 17, 2014 11:02 am

I have a fancy looking long-term trend with a TScrollpagerTool. On slower machines, scrolling around is not quite smooth. Because of that, I'd like to block auto-repainting the main chart until the mousebutton is released.

Is that possible?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TScrollpagerTool - Can I delay repainting of the main chart?

Post by Yeray » Mon Nov 17, 2014 11:35 am

Hi Jens,

The problem is you can't repaint the chart below, the subchart, without repainting the main chart.
So you can do this, but this way you don't see where are you dragging the ColorBand below until you release the mouse:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  ChartTool1.SubChartTChart.OnMouseDown:=ScrollChartMouseDown;
  ChartTool1.SubChartTChart.OnMouseUp:=ScrollChartMouseUp;
end;

procedure TForm1.ScrollChartMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
begin
  Chart1.AutoRepaint:=false;
end;

procedure TForm1.ScrollChartMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer);
begin
  Chart1.AutoRepaint:=false;
  Chart1.Draw;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jens.mertelmeyer
Newbie
Newbie
Posts: 60
Joined: Fri Nov 22, 2013 12:00 am

Re: TScrollpagerTool - Can I delay repainting of the main chart?

Post by jens.mertelmeyer » Mon Nov 17, 2014 7:40 pm

Understood, thanks.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TScrollpagerTool - Can I delay repainting of the main chart?

Post by Yeray » Tue Nov 18, 2014 8:59 am

Hi Jens,

Another alternative would be using two independent TChart, place one above the other, add a series on one of them, clone it on the other, add a colorband tool at the chart on the bottom and use the events to synchronize both charts as you wish.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jens.mertelmeyer
Newbie
Newbie
Posts: 60
Joined: Fri Nov 22, 2013 12:00 am

Re: TScrollpagerTool - Can I delay repainting of the main chart?

Post by jens.mertelmeyer » Tue Nov 18, 2014 10:22 am

Yes, I also thought of that. But I'm lazy. Why would I do that if I can also lean back, just use a TScrollpagerTool and let TeeChart do the work? :D

I probably should rather investigate the performance issue for this chart than trying to make it less obvious. Thanks for your help, as always.

Post Reply