Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: TeeChart Stacked Bars - Why are negative bars tranparent?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Nov 14, 2017 4:57 AM Last Post By: Yeray Alonso Threads: [ Previous | Next ]
Paul Holland

Posts: 5
Registered: 11/10/00
TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2017 3:39 AM
OK racked my brains on this one.

I've a chart with three bars in two StackGroups. Two bars stacked beside the third on a 3D chart.

All OK so far.

Problem is that when one or more of the stacked bars has a negative value, it is painted in a translucent way. Doesn't matter what palette I use, which of the 3D layouts is chosen.

The TeeChart version is the Vcl option that comes with RAD Studio. I've tested it with XE7 and Seattle, with identical results. Happens both in compiled code and development mode in the IDE.

I've exported the Chart as EMF and opened it outside of the program and IDE, with the same issue.

Suggestions?

Cheers, Paul
Yeray Alonso

Posts: 68
Registered: 6/12/11
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2017 6:10 AM   in response to: Paul Holland in response to: Paul Holland
Hello Paul,

Paul Holland wrote:
Problem is that when one or more of the stacked bars has a negative value, it is painted in a translucent way. Doesn't matter what palette I use, which of the 3D layouts is chosen.

The TeeChart version is the Vcl option that comes with RAD Studio. I've tested it with XE7 and Seattle, with identical results. Happens both in compiled code and development mode in the IDE.

I've exported the Chart as EMF and opened it outside of the program and IDE, with the same issue.

I've tested this with this simple example:

uses Series;
 
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i:=0 to 2 do
    with Chart1.AddSeries(TBarSeries) as TBarSeries do
    begin
      FillSampleValues;
      Marks.Visible:=False;
      MultiBar:=mbStacked;
 
      if i<2 then
         StackGroup:=0
      else
        StackGroup:=1;
 
      Chart1[i].YValue[i+1]:=-Chart1[i].YValue[i+1];
    end;
end;


And I can't reproduce the problem reported with the latest TeeChart Pro v2017.22 and with TeeChart Standard v2015.15 shipped with RAD Studio 10 Seattle.

https://i.imgur.com/bMc1yX7.png

--
Best Regards,

Yeray Alonso
Steema Software
Facebook, Twitter, GPlus, LinkedIn, YouTube, GitHub, RSS
Support Options
Paul Holland

Posts: 5
Registered: 11/10/00
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2017 3:40 AM   in response to: Yeray Alonso in response to: Yeray Alonso
Thanks Yeray for your prompt response. I've been on leave, so I've only just seen your test and results.

The image from your simple test code is subtly different from my problem, in that the stacked series are on the left. My application has the stacked pair on the right.

I'll play with this a bit and see if I can get more data.

Cheers, Paul

Edited by: Paul Holland on Nov 13, 2017 3:43 AM

http://users.tpg.com.au/pamoho/pix/SomeTransparentBars.tee.emf
Paul Holland

Posts: 5
Registered: 11/10/00
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2017 5:34 AM   in response to: Paul Holland in response to: Paul Holland
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.
Yeray Alonso

Posts: 68
Registered: 6/12/11
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2017 7:11 AM   in response to: Paul Holland in response to: Paul Holland
Paul Holland wrote:
OK that didn't take long at all.

Thanks for the code and for reporting it!

I reproduced the problem also here with the latest version, so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1942

--
Best Regards,

Yeray Alonso
Steema Software
Facebook, Twitter, GPlus, LinkedIn, YouTube, GitHub, RSS
Support Options
Paul Holland

Posts: 5
Registered: 11/10/00
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2017 6:13 PM   in response to: Paul Holland in response to: Paul Holland
Thanks Yeray. I'll monitor the public report. Just as a side issue, what is likely to be the outcome? Will I be able to get a "patch" for my RAD Studio environments?

Cheers, Paul
Yeray Alonso

Posts: 68
Registered: 6/12/11
Re: TeeChart Stacked Bars - Why are negative bars tranparent?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 13, 2017 11:54 PM   in response to: Paul Holland in response to: Paul Holland
Hello Paul,

Paul Holland wrote:
I'll monitor the public report.

You can just add your mail to the CC list to be automatically notified when an update arrives to a ticket.

Paul Holland wrote:
Just as a side issue, what is likely to be the outcome? Will I be able to get a "patch" for my RAD Studio environments?

Take a look at our Bug Fixing Policy.
I've just fixed it for the next maintenance release.

--
Best Regards,

Yeray Alonso
Steema Software
Facebook, Twitter, GPlus, LinkedIn, YouTube, GitHub, RSS
Support Options
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02