OK that didn't take long at all.
Replace your code with:
procedure TFormTestTeeChart.FormCreate (Sender : TObject);
const Vals : array [0 .. 5] of Integer = (+10, +20, +30, -30, -20, -10);
var i, j: Integer;
begin
for i:=0 to 2 do
with Chart1.AddSeries (TBarSeries) as TBarSeries do
begin
FillSampleValues;
Marks.Visible:=False;
MultiBar:=mbStacked;
if i < 1 then // if i < 2 then
StackGroup:=0
else
StackGroup:=1;
// Chart1[i].YValue[i+1]:=-Chart1[i].YValue[i+1];
for j := Low (Vals) to High (Vals) do
case i of
0 : Chart1[i].YValue[j] := Vals[j] * 1.5;
1 : Chart1[i].YValue[j] := Vals[j] * 0.5;
2 : Chart1[i].YValue[j] := Vals[j];
end;
end;
end; {TFormTestTeeChart.FormCreate}
and you get the result my application delivers. Positive values stacked are opaque, negative values stacked are translucent.
http://users.tpg.com.au/pamoho/pix/SomeTransparentBars.tee%232.png
I've tested this with Delphi 10.2.1 (Tokyo) / Teechart 2016.17.160129 32bit Vcl,
PS My code is slightly more complicated than it needed to be, because I thought I might have to play around with it to reproduce the fault. But I got lucky and hit it on first attempt
Edited by: Paul Holland on Nov 13, 2017 5:49 AM
Oh and, I am using TeeGDIplus, if that is a significant factor.
Connect with Us