C++ Builder XE4 > TeeChart > 다량 플롯 그리기 가속화 > 실행 코드(2019-04-11판)
                                            
                                                
                                                
                                                
                                                
                                                
                                                 11407 단어  성능teechartcppBuilder
                    
C++ Builder XE4
2016년 3월 31일 기사 > 이해하기 어렵다
상기를 참고로 실장을 진행하려고 했지만, 알기 어렵다.
또한 실장 실수도 발견되었다.
벌써, 정말.
실행 가능 코드 (2019-04-11 버전)
Unit1.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <VCLTee.Chart.hpp>
#include <VCLTee.Series.hpp>
#include <VCLTee.TeEngine.hpp>
#include <VCLTee.TeeProcs.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE で管理されるコンポーネント
    TChart *Chart1;
    TFastLineSeries *Series1;
    TButton *Button1;
    void __fastcall Button1Click(TObject *Sender);
private:    // ユーザー宣言
public:     // ユーザー宣言
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
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::Button1Click(TObject *Sender)
{
    Chart1->Series[0]->XValues->DateTime = true;
    Chart1->BottomAxis->DateTimeFormat = L"nn:ss";
    TDateTime dt;
    dt = Now();
    int cnt = 0;
    TDoubleDynArray xs, ys;
    // 1. 既存データの読込み
    xs.Length += Series1->XValues->Count;
    ys.Length += Series1->XValues->Count;
    for(int idx=0; idx < Series1->XValues->Count; idx++) {
        xs[cnt] = Series1->XValues->Value[idx];
        ys[cnt] = Series1->YValues->Value[idx];
        cnt++;
    }
    // 2. 追加
    const int numData = 10;  // 追加データの個数
    xs.Length += numData;
    ys.Length += numData;
    double yval;
    for (int idx=0; idx < numData; idx++) {
        yval = (1+ idx) % 2;
        xs[cnt] = dt;
        ys[cnt] = yval;
        cnt++;
        //
        dt = IncMilliSecond(dt, 100);
    }
    Series1->XValues->Value = xs;
    Series1->XValues->Count = cnt;
    Series1->XValues->Modified = true;
    Series1->YValues->Value = ys;
    Series1->YValues->Count = cnt;
    Series1->YValues->Modified = true;
    Series1->Repaint();  // 描画の更新に必要
}
//---------------------------------------------------------------------------
실행 예

비고 > 자료로서
Reference
이 문제에 관하여(C++ Builder XE4 > TeeChart > 다량 플롯 그리기 가속화 > 실행 코드(2019-04-11판)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/7of9/items/4959921dd7f1057134ee텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)