I have some questions on paging.
1) Is it possible to somehow tell TeeChart to automatically show the current graph page when paging is used? Right now I can see the first page, but when the next page is created the view is still only showing the first page. For my application I want to implement two modes of paging:
First, the user should be able to navigate between multiple pages manually. Each page holds the data of several hours (<= 24). I use a numerical up-down button that the user can use to switch between pages. There is also an automatic mode (activated by a checkbox) which completely deactivates the manual navigation and makes sure that the current page is always the most current one.
Right now I implemented the automatic mode by explicitly setting the page index to the maximum number of pages in the TeeChart.BeforeDraw event (see code below). Is this the proper way to do this?
Code: Select all
...
// calculate and set paging parameters
int maxPointsPerPage =
60 * this.configData.ChartParameters.MinutesRecordedPerChartPage / this.configData.PublishResultsInterval;
// enable paging
this.tcChart.Page.MaxPointsPerPage = maxPointsPerPage ;
this.tcChart.Page.AutoScale = false;
this.tcChart.BeforeDraw +=
(s, a) =>
{
// if, show latest page checkbox is enabled automatically always keep the last
// page the current one...
if (this.cbShowLatestPage.Checked && this.tcChart.Page.Current != this.tcChart.Page.Count)
{
this.tcChart.Page.Current = this.tcChart.Page.Count;
this.numCurrentPage.Value = this.tcChart.Page.Count;
}
};
Thanks in advance
Philipp P.