TeeChart控件_动态创建

在安装目录下找到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);
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值