Click here to Skip to main content
15,896,118 members
Articles / Desktop Programming / MFC

Using the MS Chart control in VC++

Rate me:
Please Sign up or sign in to vote.
4.45/5 (17 votes)
14 Jun 2003 258K   6.5K   74  
Setting data and labels on the MS Chart control using VC++
// TDS_chartDlg.h : header file
//
//{{AFX_INCLUDES()
#include "mschart.h"
//}}AFX_INCLUDES

#if !defined(AFX_TDS_CHARTDLG_H__6CBBAFB1_CCD4_4D67_BF1D_591A4F0F5FD0__INCLUDED_)
#define AFX_TDS_CHARTDLG_H__6CBBAFB1_CCD4_4D67_BF1D_591A4F0F5FD0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


//#include <afxdb.h>
#include <list>
using namespace std;


//-------------------------------------------
// The structure where we fill data for the 
// chart
//-------------------------------------------
typedef struct filedetails
	{
	   CString login;
	   CString n9000;
	   CString n9002;
	   CString n9004;
	   CString nCancel;
	 }FILEDETAILS;

typedef list<FILEDETAILS> FILEDETAILS_LIST;

/////////////////////////////////////////////////////////////////////////////
// CTDS_chartDlg dialog

class CTDS_chartDlg : public CDialog
{
// Construction
public:
	virtual ~CTDS_chartDlg();
	CTDS_chartDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CTDS_chartDlg)
	enum { IDD = IDD_TDS_CHART_DIALOG };
	CSpinButtonCtrl	m_SpinControl;
	CMSChart	m_ChartControl;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTDS_chartDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	FILEDETAILS_LIST m_filedetails;
	FILEDETAILS_LIST::iterator i;

	// Generated message map functions
	//{{AFX_MSG(CTDS_chartDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnDeltaposSpin1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnRefresh();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnAutorefresh();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	UINT m_Timer;
	int AddOrUpdateChartData(int noOfRows);
	int PopulateChartData();
	long lCharttype;
	//CDatabase m_oDB;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TDS_CHARTDLG_H__6CBBAFB1_CCD4_4D67_BF1D_591A4F0F5FD0__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
India India
Hi everyone!! Sometimes I get real stumped with some concepts and that gets me excited.So I say - hey let me explore - and there I go!! .Currently I am working as software engineer for Nokia Siemens Networks, Bangalore -India.My dream subject - Physics!!

Comments and Discussions