DBChart not refreshing when paging through dataset?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
doogie
Newbie
Newbie
Posts: 20
Joined: Mon Aug 07, 2006 12:00 am

DBChart not refreshing when paging through dataset?

Post by doogie » Thu Jun 21, 2007 10:08 pm

Hi

I have the following setup:
Form with DBChart1, with one series, that references dataset IBOQuery2
DBGrid that references dataset IBOQuery2
DBNavigatorBar that references dataset IBOQuery1

IBOQuery1 = master Query.
IBOQuery2 = Child Query, that just references the active record in IBOQuery1.

Now the DBChart should show the active record, and so too the DBGrid.
I run the application.
The first record shows correctly in the chart, and the grid.
when I click on next record, the DBGrid updates to accurately reflect the next record, but the DBchart does not!

:?: I tried setting DBChart.AutoRefresh to true, but doesn't help.

:idea: The only way I got the chart to update its display when scrolling the datset, was to create an onclick event for the Navbar, and then DBChart1.RefreshData;

:?: Is this behaviour correct. Shouldn't the chart refresh itself, when the datasets data changes, as I scroll through it with the navbar?

Regards

Adrian

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jun 22, 2007 7:52 am

Hi Adrian,

Have you tried calling Series.CheckDataSource method?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

doogie
Newbie
Newbie
Posts: 20
Joined: Mon Aug 07, 2006 12:00 am

Post by doogie » Fri Jun 22, 2007 10:39 am

Hi Narcis

Help me if I'm incorrect:

My understanding is that DBChart is 'DATA-AWARE'.

Thus why should I call anything to refresh the display.
The DBGrid automatically updates with to reflect the newer data as the dataset changes, why doesn't the DBChart do that?

Regards

Adrian

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

Post by Pep » Wed Jun 27, 2007 4:33 pm

Hi Adrian,

to refresh the DBChart you have to do it in similar way as in the example you can find into the Demo Features project under :
All Features -> Welcome ! -> DataBase Charts -> Single Record.

Please check the source code of this example.

Post Reply