LoginSignup
0
1

More than 5 years have passed since last update.

C++ Builder XE4 > TeeChart > 軸 > 主目盛と副目盛 > [長さ]と[間隔]と[太さ]を変更する

Last updated at Posted at 2019-01-09
動作環境
C++ Builder XE4

概要

  • 主目盛と副目盛の表示長さと間隔を変更する

実装

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 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->LeftAxis->TickLength = 10;
    Chart1->LeftAxis->MinorTickLength = 20;

    Chart1->LeftAxis->Increment = 0.2;
    Chart1->LeftAxis->MinorTickCount = 3;

    Chart1->LeftAxis->Ticks->Width = 8;
    Chart1->LeftAxis->MinorTicks->Width = 4;
}
//---------------------------------------------------------------------------

動作例

ソフト起動時
2019-01-09_16h41_10.png

Button1押下後
2019-01-09_16h54_59.png

  • 主目盛の長さが10に
  • 副目盛の長さが20に
  • 主目盛の間隔が0.2に
  • 副目盛の間隔は主目盛に対して(3+1)等分に
  • 主目盛の太さを8に
  • 副目盛の太さを4に
0
1
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
1