How can I refresh DBChart's serieses automatically ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
HCLab
Newbie
Newbie
Posts: 9
Joined: Wed Jan 31, 2007 12:00 am

How can I refresh DBChart's serieses automatically ?

Post by HCLab » Wed Jul 11, 2007 7:53 am

i could not search proffer questions/answers.

i use TeeChart 7 - Delphi7.

i've made a MDI appl similar to monitoring tools.

children forms have 5~6 serieses and each series has TOraQuery data source.

children forms alos have a timer so serieses on child form's DBChart can be refreshed with 10 sec period.

first time, i tried to requery all series's data source using for loop. but it cause to make slow main application.

next, i changed that requerying routine to refresh DBChart itself with DBChart.refresh method.

at this time serieses refreshed with not affectting main MDI form's performance. and about an hour after, serieses dont be refreshed any more.

somebody help me please.
Great JM

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Jul 11, 2007 11:15 am

Hi,

I don't know how you have configured your database tables, etc.., but a way to refresh the DBChart automatically could be to use similar code to the following example :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  DBChart1.AutoRefresh := false;
end;

procedure TForm1.Table1AfterPost(DataSet: TDataSet);
begin
  DBChart1.RefreshData;
end;

procedure TForm1.Table1AfterOpen(DataSet: TDataSet);
begin
  DBChart1.RefreshData;
end;

procedure TForm1.Table1AfterDelete(DataSet: TDataSet);
begin
  DBChart1.RefreshData;
end;

HCLab
Newbie
Newbie
Posts: 9
Joined: Wed Jan 31, 2007 12:00 am

thx

Post by HCLab » Thu Jul 12, 2007 4:33 am

ill try it thanks you
Great JM

Post Reply