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

📄 cfxstacked.cpp

📁 Delphi Component - Chart Fx
💻 CPP
字号:
// CfxStacked.cpp : implementation file
//

#include "stdafx.h"
#include "cfx98.h"
#include "CfxStacked.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCfxStacked dialog


CCfxStacked::CCfxStacked(CWnd* pParent /*=NULL*/)
	: CDialog(CCfxStacked::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCfxStacked)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CCfxStacked::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCfxStacked)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP


	// ***CFX***
	// Do not use class wizard to generate these. It will cause the generation of unecesary classes
	DDX_Control(pDX, IDC_CHART1, m_ChartFX);
	if (!pDX->m_bSaveAndValidate) // Link Chart FX pointer to control window
		m_pChartFX = m_ChartFX.GetControlUnknown();
	// ***CFX***
}


BEGIN_MESSAGE_MAP(CCfxStacked, CDialog)
	//{{AFX_MSG_MAP(CCfxStacked)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCfxStacked message handlers

BOOL CCfxStacked::DestroyWindow() 
{
	// TODO: Add your specialized code here and/or call the base class

	m_pChartFX = NULL;

	return CDialog::DestroyWindow();
}

BOOL CCfxStacked::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	int i,j; 

	m_pChartFX->Cluster = TRUE;

	m_pChartFX->OpenDataEx(COD_VALUES, 5, 10);
	for(i=0;i<5;i++)
		for(j=0;j<10;j++)
			m_pChartFX->ValueEx[i][j] = rand() % 100;
	m_pChartFX->CloseData(COD_VALUES);

	ICfxSeriesPtr pSerie;

	pSerie = m_pChartFX->Series->Item[0];

    pSerie->CylSides = 32;
    pSerie->Volume = 30;

	pSerie = m_pChartFX->Series->Item[1];

    pSerie->CylSides = 10;
    pSerie->Volume = 60;

	m_pChartFX->Series->Item[0]->Gallery = BAR;
	m_pChartFX->Series->Item[1]->Gallery = BAR;
	m_pChartFX->Series->Item[2]->Gallery = CURVE;
	m_pChartFX->Series->Item[3]->Gallery = AREA;
	m_pChartFX->Series->Item[4]->Gallery = AREA;

	m_pChartFX->Series->Item[0]->Stacked = FALSE;
	m_pChartFX->Series->Item[1]->Stacked = TRUE;
	m_pChartFX->Series->Item[2]->Stacked = FALSE;
	m_pChartFX->Series->Item[3]->Stacked = FALSE;
	m_pChartFX->Series->Item[4]->Stacked = TRUE;

	m_pChartFX->RecalcScale();

	// Colors
	m_pChartFX->OpenDataEx(COD_COLORS, 5, 0);
	m_pChartFX->Series->Item[0]->Color = CHART_PALETTECOLOR | 2;
	m_pChartFX->Series->Item[1]->Color = CHART_PALETTECOLOR | 19;
	m_pChartFX->Series->Item[2]->Color = CHART_PALETTECOLOR | 41;
	m_pChartFX->Series->Item[3]->Color = CHART_PALETTECOLOR | 15;
	m_pChartFX->Series->Item[4]->Color = CHART_PALETTECOLOR | 26;
	m_pChartFX->CloseData(COD_COLORS);

	// 3D View
	m_pChartFX->View3D = TRUE;
	m_pChartFX->AngleX = 25;
	m_pChartFX->AngleY = 45;
	m_pChartFX->View3DDepth = 120;

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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