LoginSignup
0
0

More than 5 years have passed since last update.

C++ Builder XE4 > TeeChart > グリッド線の太さをコードで変える

Last updated at Posted at 2018-12-26
動作環境
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;
}
//---------------------------------------------------------------------------

動作例

ソフト起動直後
2018-12-26_14h08_19.png

Button1押下後
2018-12-26_14h08_32.png

グリッド横方向の線の個々が丸くなった。
なぜか?

グリッド線のデフォルト定義が「Dot」であるため。
2018-12-26_14h08_57.png

丸くなるのを避けるには「Dash」を使う、など。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0