Q1:We know that NULL values could be added to series by AddNull() function.
Is there a way to Add a null array to series, something like AddNullArray?
Q2: SetNull() function can be used to set specified point to NULL,
Is there a function to set all the point to NULL?
How to add NULL array to series
Re: How to add NULL array to series
Hello,
AddArray function just loops into the given array and calls the Add() function. If you want an addNullArray, you could create it yourself. Ie:elmec wrote:Q1:We know that NULL values could be added to series by AddNull() function.
Is there a way to Add a null array to series, something like AddNullArray?
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
tmpVal: array of double;
begin
SetLength(tmpVal, 20);
for i:=Low(tmpVal) to High(tmpVal) do
tmpVal[i]:=50+random*100;
Chart1.AddSeries(TPointSeries);
AddArrayNull(Chart1[0], tmpVal);
end;
function TForm1.AddArrayNull(const Series: TChartSeries; const Values:array of TChartValue):Integer;
var t : Integer;
begin
with Series do
begin
BeginUpdate;
try
result:=High(Values)-Low(Values)+1;
for t:=Low(Values) to High(Values) do
SetNull(Add(Values[t]));
finally
EndUpdate;
end;
end;
end;
As above, you'll have to loop your array of points. Ie:elmec wrote:Q2: SetNull() function can be used to set specified point to NULL,
Is there a function to set all the point to NULL?
Code: Select all
for i:=0 to Count-1 do
SetNull(i);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |