在安装目录下找到TeeChartxxxxx.ocx
以管理员的身份打开cmd 注册TeeChartxxxxx.ocx
regsvr32 TeeChartxxxxx.ocx
VS2015 使用TeeChart绘图控件
CRect rect;
mStaticList2.GetWindowRect(rect);
mStaticList2.ShowWindow(SW_HIDE);
ScreenToClient(rect);
mTeeChart = new CTChart;
mTeeChart->Create(NULL, WS_VISIBLE | WS_CHILD, rect, this, IDC_TCHART_SYSTEM_CDDAS_MILE);
//设置标题
mTitle = mTeeChart->get_Header(); //获取标题
CStrings titleStr = mTitle.get_Text(); //获取标题内容
titleStr.Clear();
titleStr.put_Text(_T("测试程序"));
//不使用3D 默认是3D模式
mSpect = mTeeChart->get_Aspect();
mSpect.put_View3D(FALSE);
//隐藏legend
mLegend = (CLegend)mTeeChart->get_Legend();
mLegend.put_Visible(FALSE);
CAxes m_Axes1 = mTeeChart->get_Axis();//获取坐标轴
CAxis m_Left1 = m_Axes1.get_Left();//获取纵轴;Y轴
CAxis m_Bottom1 = m_Axes1.get_Bottom();//获取横轴,X轴
m_Left1.put_Automatic(FALSE);//取消自动设置
m_Bottom1.put_Automatic(FALSE);
m_Bottom1.put_Maximum(12);//设置X轴最大值
m_Bottom1.put_Minimum(0);//设置X轴最小值
//m_Left1.put_Increment(200); //设置增量
m_Left1.put_Maximum(8);
m_Left1.put_Minimum(0);
CAxisTitle mAxisLeftTitle = m_Left1.get_Title(); //得到纵轴标题
mAxisLeftTitle.put_Caption(_T("纵轴标题"));//设置纵轴标题
CAxisTitle mAxisBottomTitle = m_Bottom1.get_Title(); //得到横轴标题
mAxisBottomTitle.put_Caption(_T("横轴标题")); //设置横轴标题
//mAxisBottomTitle.put_Position()
//添加面积图
mTeeChart->AddSeries(3);