動作環境
C++ Builder XE4
処理概要
- TeeChartのグリッド線の太さをコードで変更する
実装
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 yval;
for (int idx=0; idx < 10; idx++) {
yval = (1+ idx) % 2;
Series1->AddXY(dt, yval, "", clRed);
dt = IncSecond(dt, 1);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// グリッド横方向の線
Chart1->Axes->Left->Grid->Width = 5;
}
//---------------------------------------------------------------------------
動作例
グリッド横方向の線の個々が丸くなった。
なぜか?
丸くなるのを避けるには「Dash」を使う、など。