Page 1 of 1

DBChart not refreshing when paging through dataset?

Posted: Thu Jun 21, 2007 10:08 pm
by 9347102
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

Posted: Fri Jun 22, 2007 7:52 am
by narcis
Hi Adrian,

Have you tried calling Series.CheckDataSource method?

Posted: Fri Jun 22, 2007 10:39 am
by 9347102
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

Posted: Wed Jun 27, 2007 4:33 pm
by Pep
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.