I am using VCL version 7.08 and Delphi 2006.
I need to be able to handle "bad" values in my graph by adding a null point. I can do this easily with a TLineSeries via the AddNullXY function. When I try to do this with a TFastLineSeries, a line is drawn to the point that I add with this function. I need to be able to make the fastline series behave like the line series when I add a nullxy point. Is there a property or something that I need to set in order to accomplish this?
TFastLineSeries displays null point
Hi rhyden,
you're right, this is a known issue in our wish-list to be enhanced for future releases. In the meantime, In order to do what you need, you can do something like the example bellow:
you're right, this is a known issue in our wish-list to be enhanced for future releases. In the meantime, In order to do what you need, you can do something like the example bellow:
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Series, TeEngine, ExtCtrls, TeeProcs, Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TLineSeries;
Series2: TFastLineSeries;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
LastNull: Boolean;
procedure AddValue(Series: TFastLineSeries; X,Y: Double; IsNull: Boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Series2.IgnoreNulls := False;
LastNull:=false;
for i := 0 to 10 do
begin
if ((i=2) or (i=5) or (i=6)) then
begin
Series1.AddNullXY(Series1.Count, Random(1000));
AddValue(Series2, Series2.Count, Random(1000), true);
end
else
begin
Series1.AddXY(Series1.Count, Random(1000));
AddValue(Series2, Series2.Count, Random(1000), false);
end;
end;
end;
procedure TForm1.AddValue(Series: TFastLineSeries; X,Y: Double; IsNull: Boolean);
begin
if LastNull or IsNull then
begin
Series.AddNullXY(X,Y);
LastNull:=IsNull;
end
else
Series.AddXY(X,Y);
end;
end.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |