Click here to Skip to main content
15,883,901 members
Articles / Desktop Programming / MFC

High-speed Charting Control

Rate me:
Please Sign up or sign in to vote.
4.95/5 (327 votes)
13 Jul 2010CPOL35 min read 4.2M   100.5K   787  
A flexible charting control to display 2D data
// ChartDemoDlg.h : header file
//

#if !defined(AFX_CHARTDEMODLG_H__1C3B17D7_0821_47FC_B873_9D9337728F79__INCLUDED_)
#define AFX_CHARTDEMODLG_H__1C3B17D7_0821_47FC_B873_9D9337728F79__INCLUDED_

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

#include "ChartCtrl.h"
#include "ColourPicker.h"
#include "ChartLineSerie.h"

/////////////////////////////////////////////////////////////////////////////
// CChartDemoDlg dialog

class CChartDemoDlg : public CDialog
{
// Construction
public:
	CChartDemoDlg(CWnd* pParent = NULL);	// standard constructor
 
// Dialog Data
	//{{AFX_DATA(CChartDemoDlg)
	enum { IDD = IDD_CHARTDEMO_DIALOG };
	CEdit	m_TitlesEdit;
	CListBox	m_SeriesList;
	CEdit	m_AxisMinValEdit;
	CEdit	m_AxisMaxValEdit;
	CButton	m_LegendVisBtn;
	CColourPicker	m_BackgndColSel;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CChartDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnAddseries();
	afx_msg void OnLegendVisible();
	afx_msg void OnBottomAxisRadio();
	afx_msg void OnLeftAxisRadio();
	afx_msg void OnRightAxisRadio();
	afx_msg void OnTopAxisRadio();
	afx_msg void OnAxisAutomaticCheck();
	afx_msg void OnAxisGridVisCheck();
	afx_msg void OnAxisVisibleCheck();
	afx_msg void OnAxisScrollBarCheck();
	afx_msg LONG OnChangeBckCol(UINT lParam, LONG wParam);
	afx_msg void OnChangeAxisMax();
	afx_msg void OnChangeAxisMin();
	afx_msg void OnAxisInvertedCheck();
	afx_msg void OnChangeAxisLabel();
	afx_msg void OnDeleteSeries();
	afx_msg void OnChangeTitle();
	afx_msg void OnPanCheck();
	afx_msg void OnZoomCheck();
	afx_msg void OnSaveImage();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
 
	CChartAxis* GetSelectedAxis();

	CChartCtrl m_ChartCtrl;
};

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

#endif // !defined(AFX_CHARTDEMODLG_H__1C3B17D7_0821_47FC_B873_9D9337728F79__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Belgium Belgium
I am a 29 years old guy and I live with my girlfriend in Hoegaarden, little city from Belgium well known for its white beer Smile | :) .
I studied as an industrial engineer in electronics but I oriented myself more towards software development when I started to work.
Currently I am working in a research centre in mechatronica. I mainly develop in C++ but I also do a bit of Java.
When I have so spare time, I like to read (mainly fantasy) and play electric guitar.

Comments and Discussions