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

📄 cfxgridlines.cpp

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

#include "stdafx.h"
#include "Cfx98.h"
#include "CfxGridLines.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCfxGridLines dialog


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


void CCfxGridLines::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCfxGridLines)
		// 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(CCfxGridLines, CDialog)
	//{{AFX_MSG_MAP(CCfxGridLines)
	ON_BN_CLICKED(IDC_YGRIDLINES, OnYgridlines)
	ON_BN_CLICKED(IDC_XGRIDLINES, OnXgridlines)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCfxGridLines message handlers

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

	m_pChartFX = NULL;
	
	return CDialog::DestroyWindow();
}

BOOL CCfxGridLines::OnInitDialog() 
{
	int i;

	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

    m_pChartFX->Gallery = BUBBLE;
    m_pChartFX->Volume = 100;
  
    m_pChartFX->OpenDataEx(COD_VALUES, 2, 12);
    for (i=0; i<12; i++) {
        m_pChartFX->ValueEx[0][i] = rand() % 100;
        m_pChartFX->ValueEx[1][i] = 60 + rand() % 40;
    }
    m_pChartFX->CloseData(COD_VALUES);
  
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CCfxGridLines::OnYgridlines() 
{
	// TODO: Add your control notification handler code here
	
	ICfxAxisPtr pAxis;
	VARIANT v;

	V_VT(&v) = VT_I4; 
	V_I4(&v) = AF_CURRENCY;

	pAxis = m_pChartFX->Axis->Item[AXIS_Y];
   
    pAxis->Max = 100;
    pAxis->Min = 0;
    pAxis->STEP = 20;
    pAxis->MinorStep = 10;
    pAxis->Format = v;
    pAxis->Grid = TRUE;
    pAxis->GridColor = RGB(128, 0, 0);
    pAxis->MinorGrid = TRUE;
    pAxis->MinorGridColor = RGB(128, 128, 0);
    pAxis->MinorGridStyle = CHART_DOT;
}

void CCfxGridLines::OnXgridlines() 
{
	// TODO: Add your control notification handler code here

    ICfxAxisPtr pAxis;
	VARIANT v;

	V_VT(&v) = VT_I4; 
	V_I4(&v) = AF_DATE;

	pAxis = m_pChartFX->Axis->Item[AXIS_X];
	
    pAxis->STEP = 1;
    pAxis->MinorStep = 0.5;
    pAxis->Grid = TRUE;
    pAxis->GridColor = RGB(128, 0, 0);
    //Scale and labels
	pAxis->Min = COleDateTime::COleDateTime(1998,01,07,0,0,0);
    pAxis->Format = v;
    pAxis->Style = AS_2LEVELS;

    

}

⌨️ 快捷键说明

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