Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1942 - Negative stacked bars rendered wrongly when in correlative StackGroups
Summary: Negative stacked bars rendered wrongly when in correlative StackGroups
Status: RESOLVED FIXED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: 22.170619
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: yeray alonso
URL: https://forums.embarcadero.com//threa...
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-13 10:08 EST by yeray alonso
Modified: 2017-11-14 19:48 EST (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2017-11-13 10:08:31 EST
Negative stacked bars rendered wrongly when in correlative StackGroups.
The drawing order may be revised for this scenario:

uses Series, TeCanvas, Math;

procedure TForm1.FormCreate(Sender: TObject);
var i, j, sCount, nCount, tmp: Integer;
begin
  Chart1.Legend.Visible:=False;

  sCount:=3;
  nCount:=Round(Power(2, sCount));
  for i:=0 to sCount-1 do
    with Chart1.AddSeries(TBarSeries) as TBarSeries do
    begin
      for j:=0 to nCount-1 do
      begin
        tmp:=Round(nCount / Power(2, i));

        if j mod tmp < tmp div 2 then
           Add(10)
        else
           Add(-10);
      end;

      Marks.Visible:=False;
      MultiBar:=mbStacked;

      StackGroup:=(i+1) div 2;
    end;
end;