TChart 分页问题

海嵌 2010-03-03 12:53:00
如题,不知道怎么使用TChart 的分页功能,设置了其cht_1->Pages->MaxPointsPerPage = 20;
请应用过此功能的能举例说明。
谢谢!
...全文
162 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
海嵌 2010-03-05
  • 打赏
  • 举报
回复
网上有朋友这样写的, 谁能帮着翻译为BCB,顺便测试测试下
// AddPages
NewTabSheet := TTabSheet.Create(pgMain);
with NewTabSheet do
begin
Parent := pgMain;
PageControl := pgMain;
Tag := Ord(CountTypeIndex);
Caption := arrCountType[CountTypeIndex];
end;
海嵌 2010-03-03
  • 打赏
  • 举报
回复
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;
}
以上代码可以正确翻页,但是其中的曲线数据并没有跟着变化,请问什么什么原因。

13,871

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧