Dear Yeray,
Thank you very much for your prompt reply.
I attache my test project here. It contains 2 charts (1 and 2). On the 1st chart, I display a sinus using a TFastLineSeries at the start and click on the button underneath to make it running. This works fine. On the 2nd chart, I also display a sinus vertically with a THorizLineSeries at the start and try to make it running as with the 1st chart. The both methods are same.
Unfortunately, the sinus on the 2nd chart doesn't move at all. I wonder if there are any other settings to do before elsewhere.
The source code seems to be too big to be attached here, but I can send it to you by another means.
Thank you in advance for your support.
Code: Select all
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, VclTee.TeeGDIPlus, Vcl.StdCtrls,
Vcl.Buttons, VCLTee.TeEngine, VCLTee.Series, Vcl.ExtCtrls, VCLTee.TeeProcs,
VCLTee.Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
BitBtn1: TBitBtn;
CheckBox1: TCheckBox;
Label1: TLabel;
BitBtn2: TBitBtn;
CheckBox2: TCheckBox;
Label2: TLabel;
Chart2: TChart;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Series1: TFastLineSeries; Series2: THorizLineSeries;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var i,j,k: integer; tmp: double;
begin
i:= 0;
repeat
with Series1 do begin
tmp:= Xvalues[1]-Xvalues[0];
AddXY(XValues.First-tmp,sin(2*pi/100*i),'',clBlack);
if count>200 then delete(count-1);
end;
inc(i); Label1.Caption:= IntToStr(i);
if i>2000 then i:= 0;
Application.ProcessMessages;
until checkbox1.Checked=false;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var i,j,k: integer; tmp: double;
begin
i:= 0;
repeat
with Series2 do begin
tmp:= Yvalues[1]-Yvalues[0];
AddXY(sin(2*pi/100*i),YValues.First-tmp,'',clBlack);
if count>200 then delete(count-1);
end;
inc(i); Label2.Caption:= IntToStr(i);
if i>200 then i:= 0;
Application.ProcessMessages;
until checkbox2.Checked=false;
end;
procedure TForm1.FormCreate(Sender: TObject);
var i: integer;
begin
Series1:= TFastLineSeries.Create(nil);
//Series1.FillSampleValues(20);
for i:= 0 to 200 do Series1.AddXY(i,sin(2*pi/100*i),'',clRed);
Chart1.AddSeries(Series1);
Series2:= THorizLineSeries.Create(nil);
//Series2.FillSampleValues(20);
for i:= 0 to 200 do Series2.AddXY(sin(2*pi/100*i),i,'',clRed);
Chart2.AddSeries(Series2);
end;
end.