c++ builder XE4, 10.2 Tokyo > TeeChart > seriesの最後のX値を取得する > Series1->XValues->Last();


動作環境
C++ builder XE4
    TeeChart Lite v2013.08.130414
RAD Studio 10.2 Tokyo Update 2 (追記 2018/01/10)
    TeeChart v2016.17.160129 32bit VCL

Series1の最後のX値を取得したい

Series1->XValues->Last();
というのIDEの入力補完リストで見つけた。

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)
{

    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_addClick(TObject *Sender)
{
    TDateTime lastDt = Series1->XValues->Last();
}
//---------------------------------------------------------------------------