13,871
社区成员




TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
iPage = 1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::tmr_1Timer(TObject *Sender)
{
static int index = 0;
int iTempPage;
Series1->AddXY(index++, index, "",(TColor)clTeeColor);
cht_1PageChange(cht_1); // <-- repaint page / number of pages
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
cht_1->BottomAxis->Automatic = false;
cht_1->BottomAxis->Minimum = 0;
cht_1->BottomAxis->Maximum = 20;
cht_1->Page = iPage;
cht_1->Pages->MaxPointsPerPage = 20;
//Series1->FillSampleValues(1000); // <-- some random points
//Series1->FillSampleValues(40);
cht_1PageChange(cht_1); // <-- repaint page / number of pages
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn_LastPageClick(TObject *Sender)
{
cht_1->Page = cht_1->NumPages(); // go to last page
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn_FirstPageClick(TObject *Sender)
{
cht_1->Page = 1; // go to first page
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn_PreviousClick(TObject *Sender)
{
cht_1->PreviousPage(); // <-- goto previous chart page
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn_NextClick(TObject *Sender)
{
cht_1->NextPage(); // <-- goto next chart page
}
//---------------------------------------------------------------------------
void __fastcall TForm1::cht_1PageChange(TObject *Sender)
{
cht_1->UndoZoom();
// show the current page number and the total number of pages
// (like a report)
lbl_1->Caption =
String(cht_1->Page)+"/"+String(cht_1->NumPages());
// enable or disable buttons
btn_Previous->Enabled = cht_1->Page > 1;
btn_Next->Enabled = cht_1->Page < cht_1->NumPages();
btn_LastPage->Enabled = btn_Next->Enabled;
btn_FirstPage->Enabled = btn_Previous->Enabled;
}
以上代码可以正确翻页,但是其中的曲线数据并没有跟着变化,请问什么什么原因。