//设置左坐标
with myChart.LeftAxis do
begin
Automatic:=false;
Minimum:=0;
Title.Angle:=270;
Title.Font:=Self.Font;
Title.Font.Charset:=ANSI_CHARSET;
Title.Font.Name:=’@宋体’;
Grid.Visible := False;
end;
//设置右坐标
with myChart.RightAxis do
begin
Automatic:=false;
Title.Font:=Self.Font;
Title.Font.Charset:=ANSI_CHARSET;
Title.Font.Name:=’@宋体’;
Title.Caption:=’累计百分比(%)’;
Maximum:=100;
Minimum:=0;
end;
1.4.3 如何删除一个图形中的一个点?
使用Series的delete 方法
1.4.4 如何修改一个点的X或者Y 值?
LineSeries1.Yvalue[3] := 27.1 ;
{In Bubble Series}
BubbleSeries1.Radiusvalues.value[ 8 ] := 8.1 ;
{In Pie Series}
PieSeries1.Pievalues.value[ 3 ] := 111 ;
1.4.5 如果横坐标是时间(日期),如何进行设置?
{First, you need to set the DateTime property to True in the desired X and/or Y values list.}
LineSeries1.Xvalues.DateTime := True ;
{Second, use the same above described methods, but give the values as Date, Time or DateTime values}
LineSeries1.AddXY( EncodeDate( 1996 , 1 , 23 ) , 25.4 , ’Barcelona’ , clGreen );
1.4.6 如何在chart中画出的曲线某个点上标记出该点的值?
Series.Marks.Visible:=true;
Series.Marks.Style:=smsvalue;
1.4.7 如何设置横轴或者纵轴的增长率?
Chart.BottomAxis.Increment := DataTimeStep[ dtOneHour ] ;
Chart.RightAxis.Increment := 1000;
1.4.8 如何对图象进行缩放?
TChart的ZoomRect或者ZoomPercent方法 (Pie图可能不支持缩放)
1.5 [TChart可以绘制的图形]
1.5.1 Line ( TLineSeries)
1.5.2 FastLine (TFastLineSeries) 相对Line来说,它损耗了某些属性从而来实现快速绘制
1.5.3 Bar (TBarSeries)
1.5.4 Horizontal bar (THorizBarSeries)
1.5.5 Area (TAreaSeries)
1.5.6 Point (TPointSeries)
1.5.7 Pie (TPieSeries)
1.5.8 Arrow (TArrowSeries)
1.5.9 Bubble (TBubbleSeries)
1.5.10 Gantt (TGanttSeries)
1.5.11 Sharp (TChartShape)
1.6 [TChart的实时绘制]
实时绘制对机器性能要求比较高,因此我们在编程的时候要注意下面几个方面:
ü 使用2D图形
ü 是Chart尽可能包含少的点
ü 如果需要,可以移除(remove)chart的legend(?????)和Title
ü 使用默认的字体和字体大小
ü 使用FastLineSeries
ü 使用实体(solid)画笔和画刷格式
ü 尽量避免使用圆形和环行bar样式
ü 不要使用背景图片和渐变效果样式
ü 把Chart的BevelInner和BevelOUter属性设置为bcNone
ü 如果需要,把TChart的AxisVisible属性设置为False
ü 把BufferedDisplay设置为false可以加速chart的重绘