stacked.cpp
来自「Delphi Component - Chart Fx」· C++ 代码 · 共 64 行
CPP
64 行
//---------------------------------------------------------------------------
#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 + =
减小字号Ctrl + -
显示快捷键?