Here is an image of what I am seeing:
In the data I am working with, at a specific time (X axis) the value (y axis) will instantly go to zero.
This leaves 'holes' in the chart--everything should just shift down.
I can get this to work with two series, but do not know the logic for n series of areas.
The code is pretty simple:
Code: Select all
procedure TForm46.UpdateChart;
var
I: Integer;
J: Integer;
lValue: Double;
lSrs: TChartSeries;
begin
Chart1.FreeAllSeries;
for I := 0 to spnNumSeries.Value-1 do
begin
lSrs := CreateSeries;
for J := 0 to spnNumPoints.Value-1 do
begin
lValue := GetValue(I, J);
if lValue > 0 then
lSrs.AddXY(J, lValue)
else
lSrs.AddNullXY(J, lValue);
if (lValue > 0) and (GetValue(I, J + 1) = 0) then
lSrs.AddNullXY(J, 0)
end;
end;
end;
http://www.tbinc.com/misc/TChartStackedAreaSeries.zip
How can I code this so that it does not have the 'holes'?
Ed Dressel