⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gridlines.cpp

📁 Delphi Component - Chart Fx
💻 CPP
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop

#include "gridlines.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "ChartfxLib_TLB"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
   int i;

    ChartFX1->Gallery = BUBBLE;
    ChartFX1->CylSides = 20;
    ChartFX1->Volume = 100;

    // Fill with some dummy data
    ChartFX1->OpenDataEx(COD_VALUES, 2, 12);
    for (i = 0; i < 12; i++) {
        ChartFX1->ValueEx[0][i] = (rand()*100.0)/RAND_MAX;  // Buble position
        ChartFX1->ValueEx[1][i] = 60 + (rand()*40.0)/RAND_MAX; // Bubble size
    }
    ChartFX1->CloseData(COD_VALUES);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    ICfxAxisDisp pAxis;

    ChartFX1->Axis->get_Item(AXIS_Y,&pAxis);
    // Y-Axis gridlines and formatting
    pAxis.Max = 100;
    pAxis.Min = 0;
    pAxis.STEP_ = 20;
    pAxis.MinorStep = 10;
    pAxis.set_Format(Variant(AF_CURRENCY));
    pAxis.Grid = TRUE;
    pAxis.GridColor = RGB(128, 0, 0);
    pAxis.MinorGrid = True;
    pAxis.MinorGridColor = RGB(128, 128, 0);
    pAxis.MinorGridStyle = CHART_DOT;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
    ICfxAxisDisp pAxis;

    ChartFX1->Axis->get_Item(AXIS_X,&pAxis);
    // X-Axis gridlines and formatting
    pAxis.STEP_ = 1;
    pAxis.MinorStep = 0.5;
    pAxis.Grid = True;
    pAxis.GridColor = RGB(128, 0, 0);
    // Scale and labels
    pAxis.Min = StrToDate("01/07/98");  // Starting point
    pAxis.set_Format(Variant(AF_DATE));
    pAxis.Style = AS_2LEVELS;
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -