Tchart 动态添加节点

本文介绍如何使用 Delphi 动态添加图表系列及如何为图表系列添加带有标签和颜色的数据点。此外,还提供了根据节点数量动态调整图表系列的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

动态添加节点 

Chart1.AddSeries( TFastLineSeries.Create( self ) );

 

 

添加节点坐标值

Chart1.Series[0].AddXY(X,Y,Label,color);  Chart1曲线0 坐标X Y处 添加点 

           第一条曲线是 Series[0].  

           第二条曲线是 Series[1].   依此类推


 

 

  

function AddXY(Const AXValue, AYValue: Double; Const ALabel: String; AColor: TColor): Integer; virtual;
Description
This function inserts a new point in the Series. 
The new point has X and Y values. 

The ALabel parameter is optional (can be empty ''). 
The AColor parameter is optional (can be clTeeColor). 
The function returns the new point position in the Values list.

Series1.AddXY( 123, 456, 'Hello', clGreen );

 

==============================================

if NodeNum > Chart1.SeriesCount   then //如果收到的节点地址  大于 曲线数目  增加曲线
      begin
         for i:=Chart1.SeriesCount+1 to  NodeNum   do
          begin
             Chart1.AddSeries( TFastLineSeries.Create( self ) );
             //TFastLineSeries.Create( self ).LinePen.Width:=2;       //OText.Add:='节点'+ IntToStr(i)+'温度';
             Chart1.Series[i-1].Title:='Node '+IntToStr(i)+'温度';

          end
      end ;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值