今天需要在vc6上使用曲线显示数据。所以使用TeeChart8,先注册TeeChart8.ocx

注册请看:http://www.yhf8.net/post/2012/04/17/TeeChart8Reg.aspx

新建MFC工程:

我只是用例。所以直接选对话框

添加TeeChart8.ocx组件如下:(注:在此前先注册TeeChart8.ocx组件)

记住,一定要选图标为: 的,如下

 

直接拖进,拉好显示位置:

 

添加代码:

Cpp 文件:

#include "tchart.h"
#include "series.h"
#include "valuelist.h"
#include "axes.h"
#include "axis.h"
#include "pen.h"
#include "axislabels.h"
#include "teefont.h"
#include "axistitle.h"
#include "aspect.h"
#include "fastlineseries.h"
#include "titles.h"
#include "fastlineseries.h"
#include "panel.h"
#include "legend.h"
#include "tools.h"
#include "toollist.h"
#include "annotationtool.h"

定义:

CTChart * m_chart;

在::OnInitDialog():

    m_chart=(CTChart*)GetDlgItem(IDC_TCHART1);
    //IniTchart();
    m_chart->ClearChart();
    m_chart->RemoveAllSeries();   
    m_chart->AddSeries(0);
    m_chart->AddSeries(0);
    m_chart->AddSeries(0);
    m_chart->AddSeries(0);
    m_chart->Series(0).SetTitle("第1组");
    m_chart->Series(1).SetTitle("第2组");   
    m_chart->Series(2).SetTitle("第3组");
    m_chart->Series(3).SetTitle("第4组");
    m_chart->Series(0).FillSampleValues(60);
    m_chart->Series(1).FillSampleValues(60);
    m_chart->Series(2).FillSampleValues(60);
    m_chart->Series(3).FillSampleValues(60);

结果如下:

新的下载地址:http://pan.baidu.com/share/link?shareid=2634243527&uk=1711400308

源码下载:http://pan.baidu.com/share/link?shareid=2590589786&uk=1711400308

testTee(teechart8简单用例).rarhttp://115.com/file/be7xqikj#