Code: Select all
Procedure TCustomBarSeries.DoBeforeDrawChart;
<snip>
for t:=0 to SeriesCount-1 do
{$ifdef HH_PATCH_TC_BARWIDTH}
// THis fixes a problem when using eg mixed stacked bars and a line series. If
// the line series has more datapoints than the barseries, the bars will become
// too wide, because only other barseries are originally checkd for datacount.
// This now also checks other series with YMandatory=True
if Series[t].Active then
begin
if SameClass(Series[t]) then
begin
Stop:=Stop or (Series[t]=Self);
tmp:=Series[t].Count;
if (IMaxBarPoints=TeeAllValues) or (tmp>IMaxBarPoints) then
IMaxBarPoints:=tmp;
Case FMultiBar of
mbNone: INumBars:=1;
mbSide,
mbSideAll: begin
Inc(INumBars);
if not Stop then Inc(IOrderPos);
end;
mbStacked,
mbStacked100: if NewGroup(TCustomBarSeries(Series[t]).FStackGroup) then
begin
Inc(INumBars);
if not Stop then Inc(IOrderPos);
end;
end;
if not Stop then Inc(IPreviousCount,tmp);
end
else
begin
if Series[t].YMandatory then
begin
tmp:=Series[t].Count;
if (IMaxBarPoints=TeeAllValues) or (tmp>IMaxBarPoints) then
IMaxBarPoints:=tmp;
end;
end;
end;
{$else}
if Series[t].Active and SameClass(Series[t]) then
begin
Stop:=Stop or (Series[t]=Self);
tmp:=Series[t].Count;
if (IMaxBarPoints=TeeAllValues) or (tmp>IMaxBarPoints) then
begin
IMaxBarPoints:=tmp;
if FSideMargins and (tmp>0) then // 7.06
Inc(IMaxBarPoints);
end;
Case FMultiBar of
mbNone: INumBars:=1;
mbSide,
mbSideAll: begin
Inc(INumBars);
if not Stop then Inc(IOrderPos);
end;
mbStacked,
mbStacked100: if NewGroup(TCustomBarSeries(Series[t]).FStackGroup) then
begin
Inc(INumBars);
if not Stop then Inc(IOrderPos);
end;
mbSelfStack: INumBars:=1;
end;
if not Stop then
Inc(IPreviousCount,tmp);
end;
{$endif}
<snip>