找的一些国外TeeChart资料

MFC中使用TeeChart绘制三维曲线 TeeChart控件功能强大,也在MFC中被广泛使用。但是在绘制三维曲线和二维曲线有一定区别,新手容易遇到一些意想不到的麻烦。这里尝试写一个简单的demo,详细地写出绘制三维螺旋线的每一步。 阅读详情
The following notes have been compiled on the TeeChart configurations I’ve found useful in my applications.  TeeChart is very comprehensive which can tend to make it a little complex to understand and use. I find that in most applications I need to configure the chart and series’ in run-time, and so these examples focus on that approach. The following examples are based on TeeChart Pro version 6 and I commonly use the TChart and TChartGrid components.

The information contained in this document is believed to be reliable however Creative Analytics Pty Ltd does not guarantee its completeness or accuracy.
Configuring the Chart

By default TeeChart will place the values of the series in the legend, however I prefer the series names so I generally set the following two properties.

Chart.Legend.LegendStyle := lsSeries;  //to display series’ names in legend
Chart.Legend.ShadowSize := 0;   //to remove shadow in legend
Chart.Legend.Visible := True;

I find the following method useful to undo a user-invoked zoom.

Chart.UndoZoom;

Configuring an Axis

It is possible to set the range of any axis (rather than have it automatic).  The labels can also be set at an angle by specifying the angle in degrees.

Chart.BottomAxis.Automatic := False;
Chart.BottomAxis.SetMinMax(0, 1);
Chart.BottomAxis.LabelsAngle := 90;

Adding and Configuring a Series

When you add a series to a chart in run-time, there are quite a few properties that need setting, so I often use a local procedure for this and MyLine or MyBar are local variables.

Most of the properties are self explanatory, however:

    * The Marks property relates to coloured rectangles with a text string near to each Series point.
    * The pointer property relates to boxes or circles etc at each data point in addition to the series line
    * The XValues.DateTime is used for timeseries data (see below).
    * The MultiBar property of the TBarSeries is used to specify whether the series is stacked on another bar series or simply drawn beside.
    * The BarPen.Visible property specifies whether a line is drawn around each bar.

procedure AddLineSeries(const Title: string);
begin
  MyLine := TLineSeries.Create(Chart);
  Chart.AddSeries(MyLine);
  MyLine.Title := Title;
  MyLine.ShowInLegend := True;
  MyLine.Marks.Visible := False;
  MyLine.Pointer.Visible := True;
  MyLine.XValues.DateTime := True;
  MyLine.LinePen.Width := 2;
end;


procedure AddBarSeries(const Title: string);
begin
  MyBar := TBarSeries.Create(Chart);
  Chart.AddSeries(MyBar);
  MyBar.Title := Title;
  MyBar.ShowInLegend := True;
  MyBar.Marks.Visible := False;
  MyBar.MultiBar := mbStacked;
  MyBar.BarPen.Visible := False;
end;

The Pointer property relates to boxes or circles etc at each data point in addition to the series line.

MyLine.Pointer.Style is one of psRectangle, psCircle, psTriangle, psDownTriangle, psCross, psDiagCross, psStar, psDiamond, or psSmallDot

By default each series has the same pointer (!) so I use the following to set a different pointer styles for each series.  I set p to zero for the first series, and then incrementing it for each series, checking that p is valid.

MyLine.Pointer.Style := TSeriesPointerStyle(p);
if p > Ord(High(TSeriesPointerStyle)) then p := 0; //Check for valid p

The Y values can be sorted using the following:

MySeries.YValues.Order := loDescending;
MySeries.YValues.Sort;
MySeries.XValues.FillSequence;

Adding Data to a Series

The easiest way to add data is to using the Add method, specifying the Y value and its associated label.  For example:

for i := 0 to n-1 do
  MyBar.Add(YData[i], MyLabel[i]);

Y values can be modified in a series as follows:

for i := 0 to n-1 do
  MyLine.YValue[i] := YData[i];

X labels can be modified in a series as follows:

for i := 0 to n-1 do
  MyLine.XLabel[i] := MyLabel[i];

Alternatively, an array of data can also be added in one hit as follows (YData is an array of Real):

for s := 0 to Chart.SeriesCount-1 do
  Chart.Series[s].AddArray(YData);

Copying to the Clipboard

Copying the chart as a picture is straightforward, however if we just use a standard method such as Chart.CopyToClipboardMetafile(True) we may get a border on the top and left side (depending on the Bevel settings). So I tend to set the Bevel’s to bvNone before calling the copy to remove the partial-border.

procedure TMainForm.BtnCopyChartClick(Sender: TObject);
begin
  Chart.BevelInner := bvNone;
  Chart.CopyToClipboardMetafile(True);
  Chart.BevelInner := bvLowered;
end;

Copying the data underpinning a chart is a bit more complex, however the following seems to work well.  (This requires TeeStore in uses clause).

procedure TMainForm.BtnCopyDataClick(Sender: Object);
var
  Data: TSeriesDataText;
begin
  Data := TSeriesDataText.Create(Chart, nil);
  try
    Data.IncludeLabels := True;
    Data.IncludeHeader := True;
    Data.IncludeIndex := False;
    Data.IncludeColors := False;
    Data.CopyToClipboard;
  finally
    Data.Free;
  end;
end;

Saving and Loading tee Files

Saving and loading charts as TeeChart files has a couple of complications. The procedures are globals, and not methods of the Chart object.  They require both TeeStore and TeeEdiSeri (!) in the uses clause.  The application will compile with just TeeStore but will generate run-time errors if you don’t include TeeEdiSeri.

LoadChartFromFile(TCustomChart(Chart), FileName);
SaveChartToFile(Chart, FileName, True);

Events and linked components such as a popup menu cannot be saved, and you must set all events to nil before saving the chart and re-assign them after the chart is loaded.
Functions

There are many things you can do with functions. What I’ve used here relates to creating a series that is the total of the other series.  This requires TeeFunci in uses clause.

Create the TLineSeries as above then

MyLine.SetFunction(TAddTeeFunction.Create(Self));
for i := 0 to Chart.SeriesCount-1 do
  MyLine.DataSources.Add(Chart.Series[i]);
MyLine.CheckDataSource;  //required to update function-series!

Apparently this is the correct way of using a TeeFunction, however it does create an access violation when exiting the application.  This is a bug and the work-around is to include a Chart.FreeAllSeries in the FormClose event.
Timeseries Charts

Datetime based series can be plotted in TChart by setting the DateTime property of the XValues property.  The datetime format of the bottom axis can be specified and then TChart will create x-axis labels according to your format with having to expressly define labels. I tend to use the AddXY() method when adding data to a timeseries chart, where X is your timestamp and Y is the value at that timestamp.

MyLine.XValues.DateTime := True;
Chart.BottomAxis.DateTimeFormat := 'hh:mm';
Chart.BottomAxis.Increment := DateTimeStep[dtOneMonth];
Chart.BottomAxis.Increment := DateTimeStep[dtThirtyMinutes];

Gantt Charts

I set the Order properties because I didn't want the chart to automatically sort each series. I wasn't sure how many series' I should have, but I just used one series for 50 plus bars in the Gantt chart.  You can then superimpose other series (such as a line) over the Gantt if your require this.

MyGantt := TGanttSeries.Create(Chart);
Chart.AddSeries(MyGantt);
MyGantt.ShowInLegend := False;
MyGantt.XValues.Order := loNone;
MyGantt.YValues.Order := loNone;
MyGantt.ConnectingPen.Width := 2;
For i := 0 to n-1 do
  MyGantt.AddGanttColor(StartDate[i], EndDate[i], i, Name[i], MyColour[i]);

3-D Charts

While 3D charts look cool, they are harder to read than a 2D chart so I don’t tend to use them too much. They are a little more complex to configure (and populate with data) than a 2D series, but this is how I’ve implemented a 3D surface.

MySurface := TSurfaceSeries.Create(Chart);
Chart.AddSeries(MySurface);
Chart.DepthAxis.Visible := True;
Chart.View3DOptions.Orthogonal := False;
Chart.View3DOptions.Zoom := 90;
Chart.Chart3Dpercent := 40;
MySurface.IrregularGrid := True;
MySurface.UseColorRange := False;
MySurface.UsePalette := True;
MySurface.PaletteStyle := psPale;
MySurface.Pen.Visible := True;
MySurface.ShowInLegend := False;
for i := 0 to n-1 do
  for j := 0 to m-1 do
    MySurface.AddXYZ(j, MyData[i,j], i);

TChartGrid

I have found that the grid doesn’t always populate properly and so I always call ChartGrid.RecalcDimensions once I’ve finished adding series and data.

The top left cell in the ChartGrid contains the word “Text” by default, and this can be changed by setting the global variable: TeeMsg_Text := ‘my text’.  This requires the TeeConst in the uses clause.
delphi中Tee-chart安装程序 Delphi的程序有时需要Teechart控件,我这里就有了,请使用 立即下载

相关推荐

VS2010中MFC利用TeeChart控件实现画三维图

该例程实现了VS2010下利用TeeChart控件绘制三维图

Delphi中TeeChart的各种属性

概述:主要说明在delphi中TeeChart的各种属性,以及提供一个TeeChart的使用实例。 TeeChart控件介绍 TeeChart   Pro是西班牙Steema   SL公司开发的图表类控件,主要用来生成各种复杂的图表。熟悉Delphi和C++  Builder的编程人员对它不会陌生,因为在Delphi和C++   Builder里包括了TeeChart的VCL版本。

wozengcong的专栏 5399

Carla-编译CarlaUE4提示HoloLens.Automation项目缺少Windows程序集?

编译CarlaUE4提示HoloLens.Automation项目缺少Windows程序集?不妨看看这个!

DSK_981029的博客 2573

MFC TeeChart用法整理 三(三维图)

画三维图,就要添加三维类型的序列。 这里我们仍然以折线图作为范例。右击控件选择Properties,在TeeChart Pro Editor选项卡中单击Edit Chart,在弹出来的对话框中单击Add,在3D选项卡中选中Point 3D类型,单击左下角的倒三角,选择 No Point风格,如下图所示。 下面我们开始添加代码: m_TeeChart...

dinggujiao8462的博客 800

量子城域网系列(六):从星型到环形,解析QKD网络拓扑的演进与选型

本文深入解析了量子密钥分发网络从星型到环形等主流拓扑结构的演进历程与核心原理。针对量子城域网的实际部署,文章详细对比了星型、总线型和环形拓扑的优缺点,并结合政务云、金融网点等典型应用场景,提供了实战选型指南,帮助读者在物理限制、安全需求与成本效率间找到最佳平衡。

weixin_29197835的博客 111

八大核心深度学习算法详解:从CNN到Transformer的完整指南

深度学习作为人工智能的核心技术,通过多层神经网络模拟人脑学习机制。其基本原理是利用反向传播算法优化网络参数,从数据中自动提取特征表示。这一技术价值在于能够处理高维复杂数据,在图像识别、自然语言处理等领域实现突破性进展。卷积神经网络(CNN)通过局部连接和权值共享有效处理图像数据,而Transformer架构基于自注意力机制革新了序列建模方式。在实际工程实践中,CNN广泛应用于计算机视觉任务,如图像分类和目标检测;Transformer则成为自然语言处理的主流架构,支撑着BERT、GPT等预训练模型。本文系统

aoe41606的博客 432

teechart的有关网页

teeChart资料http://blog.youkuaiyun.com/mounting/article/details/5748426 找的一些国外TeeChart资料http://blog.youkuaiyun.com/player26/article/details/2881914 TeeChart经验总结.docx(delphi)http://ishare.iask.sina.com

768

微信公众号 - 最新详细实现H5网页接入微信支付功能,开发移动端、PC端网站集成使用微信支付流程及示例代码,公众号网页利用JS-SDK/JSAPI/H5支付授权唤起微信支付,可脱离微信环境支付或内置浏

微信公众号,微信支付,网页,移动端,h5,扫码支付,二维码付款,手机网页,电脑pc网页生成支付二维码,js-sdk,jsapi,外部浏览器调起微信支付,脱离微信环境,在微信内置浏览器如何进行微信支付,前端H5微信支付,web网站,vue2,vue3,nuxt2,nuxt3,jquery,微信公众号h5支付流程,如何实现,怎么做,回调报错,redirect_uri参数错误,必须部署才能调试吗,怎么不打包发布就能在本机测试,微信H5支付能力,uniapp微信支付,h5页面调起支付,支付没反应,无效,失败,H5页

🏆 前端领域优质创作者 6105

asp毕业设计——基于asp+sqlserver的考试成绩分析系统设计与实现(毕业论文+程序源码)——考试成绩分析系统

在不断信息化的今天,网络的出现让人们能够更快地获取更多的信息。各个领域都引进了计算机网络来为他们提高办事效率。在学校的教学管理中,利用计算机网络实现学生成绩信息的管理、统计和分析势在必行。本系统旨在提高学校对学生考试成绩管理工作的效率,使之成为现代教学信息化服务体系的重要组成部分。本系统采用B/S模式开发,以ASP作为主要的开发技术, SQL Server2000作为后台数据库服务器,采用Dreamweaver MX2004制作页面。

m0_66238867的博客 562

ESP32S3接入讯飞在线语音识别教程及配套源代码

本文介绍了如何使用ESP32-S3开发板实现讯飞在线语音识别功能。首先,需要准备硬件设备,包括ESP32-S3开发板、麦克风模块、MicroSD卡模块和扬声器模块。接着,安装Arduino IDE并配置ESP32-S3开发环境,注册讯飞开放平台账号并获取API凭证。然后,通过I2S接口连接麦克风模块,并编写代码实现语音录制、Base64编码、API请求和识别结果处理。代码包括初始化WiFi、麦克风、系统时间,以及录制语音、发送请求、解析响应等功能。最后,通过按键触发录音,并将识别结果输出到串口。

2401_88800025的博客 748

关务管理项目专题:SAP 与关衡关务系统的进出口报关业务集成(1)需求和方案整理

一个拥有进出口业务的企业就需要报关,而关务系统就是用来辅助企业日常进出口报关,同时数字化、合规化报关业务的有效工具。本章属于关务管理项目专题系列,以 SAP 与关衡关务系统的进出口报关业务集成为实例,详细讲解报关业务的需求和方案整理。

SAP李斌,本人承诺所有原创文章均不使用任何AI生成技术,请大家放心阅读。 2078

如何汉化没有源码的DELPHI组件

http://www.romandion.com/Program/program002.htm在DELPHI中,许多组件都是以BPL、DCP的形式出现的。某些优秀的组件,特别是国外一些优秀的组件,出于版权的考虑,没有提供DPK和PAS的源码,而仅仅有BPL、DCP、DCU、DFM等二进制形式提供。出于业务的需要,有时候需要将组件直接呈现给用户,但是英文版的组件直接提供给用户,那么很郁闷的事

romandion的专栏 1917

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

teechart的addarray_【TeeChart Pro ActiveX教程】(六):使用系列(下)

【TeeChart Pro ActiveX教程】(六):使用系列(下)将数据添加到系列大多数系列类型(ODBC数据源教程8和函数教程7除外)使用Add和ADDXY方法添加数据。 有一些例外,请参阅下表,了解它们如何区别的示例:Series TypeAdd Series pointsDelete Series pointsBasicGanttGanttSeries.AddGanttGanttSeri...

weixin_28699983的博客 1136

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

TeeChart绘图控件 - 之三 - 提高绘图的效率

TeeChart是个很强大的控件,其绘图能力之强,其他控件难以比拟,但是有个问题就是他的绘图速度,其实TeeChart绘图速度还是很快的,只是大家一直都没正确运用其功能所以导致绘图速度慢的假象。 下面说说影响绘图速度的两个主要因素 1、当点数特别多时不需要绘出全部点(性能提升不大) TeeChart绘图控件 - 之一文章里已经讲过,可以设置只绘出部分点。设置方法如图:

LL-Studio的专栏 2万+

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Tchart

本文主要讲解Delphi中Chart,TeeChart的属性,方法及用法.Tchart分析报告,TeeChart使用指南,TeeChart控件介绍1.AllowZoom : Boolean是否允许鼠标拖动来缩放图表2.AnimatedZoom : Boolean拖动是否显示缩放过程3.AxisVisible : Boolean显示和隐藏4个子图表4.BufferedDisplay :Boolean

阿斗delphi博客 5684

VS2013 TeeChart_v8 MFC C++ 使用手册干货(一)TeeChart ColorGrid类的简单使用

Teechart8在VS2013中的使用方法与Teechart5有所不同

二十三年弃置身 1939

eacharts柱状图

eacharts柱状图 先看效果图 <div id="distribution_BP_AVG" style="width:600px;height:400px;"></div> drawLine(){ var TypeArr =['≤25', '26--30', '31--35', '36--40', '41--45', '46--50', '51--55', '56--60', '61--65', '66--70', '71--75', '76--80', '81--85', '

qq_45479398的博客 1086

TeeChart For VCL/FMX V2017使用教程:第七章-使用函数

内容 函数类型 (1)         函数特点 (2)         添加一个函数 (3)         定义一个数据源 (4)         函数周期 (5)         函数周期对齐 (6)         派生自定义函数(仅VCL)7.1 函数类型7.1.1 函数特点        一个TeeChart  Pro函数是一个序列,它几乎可以是任何序列类型,它...

千里独行的专栏 922

uni-app中使用图表eacharts

uni-app中使用图表eacharts

shiyibushiwei的博客 1664

【TeeChart for Java教程】(六)下:使用系列——在图表上混合系列类型

【下载TeeChart for Java最新版本】 (一)在图表上混合系列类型 TeeChart Pro提供了一个空的Chart Canvas作为数据系列的背景,这意味着没有预定义图表类型。您可以将所需的图表类型定义为要显示的系列类型的混合。由于某些系列类型的特殊性质,在图表上混合一些系列类型是不切实际的。当您到达添加新系列时,TeeChart会通过在图表库中显示不合适的系列类型来帮助您,您可...

xiaochuachua的博客 265

图表控件TeeChart干货分享(绘制2D、3D实时曲线---VC++示例源代码--网络首发)

最近接手了一个项目,其中涉及到MFC和实时曲线显示的问题,由于我之前从未接触过此类技术,现学现搞,把其间用到的觉得对初学者有用的东西,总结一下。 尤其是关于TeeChart控件部分,网上资料零碎,且很多不全面,代码难以使用。我苦寻数周在外国一些网站上寻到了一些有用的信息,把相关的可运行的代码示例贴在文中,希望能帮到后来者。     MFC部分: 一、 分割窗体 新建一个单文档的MFC

菜鸟的自留地-mooyang 4万+
上一篇: Teechart 代码 C++ (转) 很全的Teechart应用
下一篇: 键盘代码对照表
萱哥老了
博客等级 码龄22年 38粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值