怎样动态修改TeeChart控件的大标题

怎样动态修改TeeChart控件的大标题,第1张

控件变量为m_ctrlChart

以下为实现代码(vc)

CSeries Ser=m_ctrlChart.Series(0)

Ser.SetTitle("交信握易记录变化曲线"顷前)//滑乎庆设置曲线标题

CString xxx=Ser.GetTitle()

TeeChart的图表斗禅的标题设置方空猛尘法

tChart1.Header.Text

=

"图表"

tChart1.Header.Lines

=

new

string[]

{

"图表1","图表2","图表3"

}

//标题

设置Header的Text或者Lines,任选一个即可,这两个是会相互覆盖的

Text仅仅设置知罩一行;The

Text

property

is

used

to

display

customized

strings

inside

Shapes.

1.注册TeeChart5.ocx

先将TeeChart5.ocx文件拷贝到工程文件夹中。然后,打开命令提腊拆示符,cd进入TeeChart5.ocx所在路径,输入“轮手枣regsvr32 TeeChart5.ocx”,注册TeeChart5.ocx。注册成功后,会有一个提示框。如果不想使用可以输入命令“薯竖regsvr32 –u TeeChart5.ocx”解除注册。

2.新建工程,将自带的类放到一个文件夹中,例如“src”。因为添加TeeChart后会生成很多新的类,看起来不方便。

3.将TeeChart控件加到Control List中

Project->Add To Project->Components and Controls->Registered ActiveX Control->TeeChart Pro Activex control v5->insert

这时,在Control List的右下角多了一个圆形的小图标,在类视图中多出了许多的新类,将他们放在一个文件夹中,例如“teeChart”。

以下,将说明如何具体的使用TeeChart控件 4.拖拽TeeChart到对话框中

拖拽TeeChart到对话框中,调整TeeChart的大小,稍作修改,界面设计就完成了。右击控件->属性->teechart pro editer选项卡->edit chart。出现一个名为Edit的对话框。这个对话框非常重要,包括了teechart的各种属性。 简要介绍一下各属性:

Series:该属性包含需要绘制的图表的类型,如曲线、饼图、柱状图等等,种类很多。 Chart:该选项包含了图表的显示部分的很多属性,如坐标轴、背景、标题等等。 Data:绘制图表需要的数据。

Export:包含了一些将图表导出为图片格式的选项。 Print:打印设置。

Themes:图表的主题,主要是显示方式。

5.建立变量

使用类向导建立teechart的对象:CTChart m_chart在xxxDlg.cpp文件中添加以下头文件: #include "axis.h"

#include "axes.h"

#include "scroll.h"

#include "series.h"

//#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 "titles.h"

#include "fastlineseries.h"

#include "panel.h"

#include "legend.h"

#include "tools.h"

#include "toollist.h"

#include "annotationtool.h"

#include "page.h"


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/12329416.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-22
下一篇2023-05-22

发表评论

登录后才能评论

评论列表(0条)

    保存