Single Record

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kai
Newbie
Newbie
Posts: 21
Joined: Mon May 10, 2004 4:00 am

Single Record

Post by kai » Thu May 13, 2004 3:45 am

Hi,
How do you display the next record in a table when using the "Single Record" mode for a series? The chart seems to display the current record, but how do I navigate the table and get the chart to display different records?

Thanks.

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

Post by Pep » Thu May 13, 2004 3:34 pm

Hi Kai,

Indeed, a TDBChart is not refreshed if record position changes. I've tried this with TeeChart v7 (the "DBChart_SingleRecord.pas" example) and the chart was not refreshed as I moved from one record to another. The workaround in this case (and I guess in similar cases) is to use dataset events together with TDBChart.RefreshData method to refresh chart when appropriate. In DBChart_SingleRecord.pas case, adding RefreshData call to TTable.OnAfterScroll event should do the trick:

Code: Select all

procedure TDBChartSingleRecord.Table1AfterScroll(DataSet: TDataSet);
begin
  inherited;
  DBChart1.RefreshData;
end;
The same approach can be used for TTable.OnAfterPost, OnAfterOpen, ... events.

Post Reply