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

📄 stacked.cpp

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

#include "stacked.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "ChartfxLib_TLB"
#pragma link "OleCtrls"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
   	short i,j;
    ICfxSeriesDisp pSeries;

    // Init data
    ChartFX1->OpenDataEx(COD_VALUES, 6, 10);
    for (j = 0; j < 10; j++)
    	for (i = 0; i < 6; i++)
            ChartFX1->ValueEx[i][j] = 10.0 + rand()*90.0/RAND_MAX;
    ChartFX1->CloseData(COD_VALUES);

    // Produce 2 bars and 1 curve
    ChartFX1->Series->get_Item(0,&pSeries);
   	pSeries.Gallery = BAR;

	pSeries = NULL;
    ChartFX1->Series->get_Item(1,&pSeries);
    pSeries.Gallery = BAR;
    pSeries.Stacked = True; // On top of 0

	pSeries = NULL;
    ChartFX1->Series->get_Item(2,&pSeries);
    pSeries.Gallery = BAR;

	pSeries = NULL;
    ChartFX1->Series->get_Item(3,&pSeries);
    pSeries.Gallery = BAR;
    pSeries.Stacked = True; // On top of 2

	pSeries = NULL;
    ChartFX1->Series->get_Item(4,&pSeries);
    pSeries.Gallery = BAR;
    pSeries.Stacked = True; // On top of 3

	pSeries = NULL;
    ChartFX1->Series->get_Item(5,&pSeries);
    pSeries.Gallery = CURVE;
    pSeries.MarkerShape = MK_NONE;
    pSeries.LineWidth = 3;

    // Adjust scale
    ChartFX1->RecalcScale();
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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