TeeChart经验总结 6.Series之1:Line

TeeChart提供了很多类型不同的Series,下面是比较常用的.

创建Series可以通过TeeChart Editor,如下

 View下面,可以选择显示

或者使用代码创建,如下Series Name(选中就可以修改Name,不选中可以修改Title),Series Group;可以创建Series Group进行管理.
Clone可以复制一个新的Series,Change可以修改已经创建好的Series的类型.

 1 Series := TFastLineSeries.Create(aChart);
2 //线所在Chart
3 Series.ParentChart := aChart;
4 //指定自定义Axis
5 Series.CustomVertAxis := aAxis;
6 //线宽度
7 Series.Pen.Width := aPenWidth;
8 //线颜色
9 Series.Color := aColor;
10 //线名称
11 Series.Title := aTitle;

Series常用的添加数据函数

 1 Function Add(Const AValue:Double; Const ALabel:String='';
2 AColor:TColor=clTeeColor):Integer; overload; virtual;
3 Function AddArray(Const Values:Array of TChartValue):Integer; overload;
4 Function AddNull(Const Value:Double):Integer; overload;
5 Function AddNull(Const ALabel:String=''):Integer; overload; virtual;
6 Function AddNullXY(Const X,Y:Double; Const ALabel:String=''):Integer; virtual;
7 Function AddX(Const AXValue:Double; Const ALabel:String='';
8 AColor:TColor=clTeeColor):Integer;
9 Function AddXY(Const AXValue,AYValue:Double; Const ALabel:String='';
10 AColor:TColor=clTeeColor):Integer; virtual;
11 Function AddY(Const AYValue:Double; Const ALabel:String='';
12 AColor:TColor=clTeeColor):Integer;

下面开始说Line Series.

Border...:用来修改在3D显示Line Series边缘是否显示,颜色,宽度等等.在非3D情况下,用于Line Series的显示,宽度等等.
Color...:Line Series的颜色.
Pattren...:还是用于3D显示的图案.
Drak 3D:3D阴影.
Color Each, Color Each Line:每个点之间的线一种颜色,这个被选中,则Color属性无效.
Clickable:可点击.
Line Mode:Stairs:阶梯;Inverted:反转.
OutLine:轮廓.这个功能实现的很怪,如果修改了这个,则Series Color无效.
Height 3D:3D显示下Line的高(厚)度.
Stack:这是一个比较复杂的设置.当有多个Line Series的时候,这个属性用来表示这些个Line Series的关系.
None:在3D显示中,每个Line Series一个独立的ZOrder.

Overlap:交错,在3D显示中,在同一个ZOrder中显示这些Line Series.

Stack,Stack100:比较Line数值,前者使用实际值,后者使用0-100.数学比较差..不知道该如何描述.

Treat Nulls:处理空值.分为:Don't Paint(不绘),Skip(跳过),Ignore(忽略).Series里有一个基础方法AddNull.
Shadow:3D显示的时候没有试出来,2D显示的时候很明显.
Gradient:3D显示时将Z上颜色渐变色.

Line其实是通过AddXY或者类似的函数添加的点连接而成的曲线,Point就是是否来显示这个点,以及显示这个点的属性.
大部分的属性之前都介绍过.

Show In Legend:显示在Legend中.
Cursor:游标,只有当之前的Clickable被选中,这个属性才有用.
Depth:单独设置Line Series的深度,如果选择Auto,则和Chart整体保持一致.
Horizontal Axis:指定Line Series的水平Axis.
Vertical Axis:指定Line Series的垂直Axis.
DateTime:把Axis的值设置为时间.设置这个属性只要修改Series.XValues.DateTime或者Series.YValues.DateTime即可.做柱形图的月份统计,这个属性经常被用到.
Formats:设置显示值的格式.
Show In This Editor:是否显示在TeeChart Editor内.
Sorts:排序.

Marks,标记,用于显示添加数据这些函数中的ALabel参数,或者其他的Style.如下:

 1 TSeriesMarksStyle=( smsValue,             { 1234 }
2 smsPercent, { 12 % }
3 smsLabel, { Cars }
4 smsLabelPercent, { Cars 12 % }
5 smsLabelValue, { Cars 1234 }
6 smsLegend, { (Legend.Style) }
7 smsPercentTotal, { 12 % of 1234 }
8 smsLabelPercentTotal, { Cars 12 % of 1234 }
9 smsXValue, { 1..2..3.. or 21/6/1996 }
10 smsXY, { 123 456 }
11 smsSeriesTitle, { Series1 } // 8.0
12 smsPointIndex, { 1..2..3... } // 8.0
13 smsPercentRelative { 100%..90%..120%... } // 8.0
14 );

其他的比如Arrows(箭头),Symbol(符号,这个和之前在Legend中介绍的那个属性一样),剩下的属性之前都提到过.

原文地址:https://www.cnblogs.com/solokey/p/2118676.html