Stacked bars
Posted: Tue Apr 08, 2014 2:46 pm
We are using the TeeChartStandard2014 package.
I am testing with the MultiBar mbStacked option with this sample code:
The data i want to use for the bars are only at some points identical, so i try to use mbStacked.
But if i have some values which are unique the bars are "up in the air" .
The result looks like this.
Any Ideas what i am doing wrong?
I am testing with the MultiBar mbStacked option with this sample code:
Code: Select all
var
i, j: Integer;
tmpDates: array of TDateTime;
setLength(tmpDates, 5);
for i:=0 to High(tmpDates) do
if i mod 2 = 0 then
tmpDates[i]:=IncDay(Today, i*2)
else
tmpDates[i]:=IncDay(Today, (i*2)+1);
for i:=0 to 1 do
with frmChart.ChartAccounting.AddSeries(TBarSeries) as TBarSeries do
begin
MultiBar:=mbStacked;
MarksOnBar:=False;
MarksLocation:=mlCenter;
CustomBarWidth:=40;
XValues.DateTime:=true;
for j:=0 to High(tmpDates) do
begin
if j mod 2 = 0 then
begin
AddXY(tmpDates[j]+i, 25+random*75, 'S' + inttoStr(i) + ' L' + IntToStr(j));
end
else
begin
AddXY(tmpDates[j], 25+random*75, 'S' + inttoStr(i) + ' L' + IntToStr(j));
end;
end;
end;
But if i have some values which are unique the bars are "up in the air" .
The result looks like this.
Any Ideas what i am doing wrong?