動作環境
C++ builder XE4
TeeChart Lite v2013.08.130414
RAD Studio 10.2 Tokyo Update 2 (追記 2018/01/10)
TeeChart v2016.17.160129 32bit VCL
TeeChartで余分となった点をシリーズから取り除く方法。
参考
https://www.steema.com/files/public/teechart/java/v1/docs/Tutorials/tutorial6.htm
Unit1.cpp
//---------------------------------------------------------------------------
# include <vcl.h>
# pragma hdrstop
# include <DateUtils.hpp>
# include "Unit1.h"
//---------------------------------------------------------------------------
# pragma package(smart_init)
# pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormShow(TObject *Sender)
{
Chart1->Series[0]->XValues->DateTime = true;
Chart1->BottomAxis->DateTimeFormat = L"nn:ss";
TDateTime dt;
dt = Now();
double dval;
for (int idx=0; idx < 100; idx++) {
dval = (double)random(60);
Series1->AddXY(dt, dval, L"", clRed);
dt = IncSecond(dt, 1);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::B_removeFirstClick(TObject *Sender)
{
Series1->Delete(0);
}
//---------------------------------------------------------------------------
removeFirstボタンを押すたびに先頭のデータが取り除かれていく。
大量に取り除くにはDelete()を繰り返すことになるのだろうか。