tags:

views:

61

answers:

2

hi..i use this code:

while not sqlDebtors.eof do begin
  fAmtOut := 0;
  fAmt := 0;
  sBranch := sqlDebtors.fieldbyname('Branch').AsString;
  while (not sqlDebtors.Eof) and (sqlDebtors.FieldByName('Branch').AsString             =sBranch) do begin
     fAmtOut := fAmtOut + sqlDebtors.fieldbyname('Outstanding').asfloat;
     fAmt := fAmt + sqlDebtors.fieldbyname('Amount').asfloat;
     sqlDebtors.Next;
  end;
  pbar.add(fAmtOut, sBranch);
  pbar.add(fAmt, sBranch);
end;

my graph draw like this alt text

but i want to group my graph to be side bar graph so its can group by branch like this: alt text

hope anyone can help me.thanks.

A: 

Try:

pBar.MultiBar := mbSide;
Alan Clark
A: 

You need to have two BarSeries. So just add another one, let's say pBar2 (either in code or in the Designer). then just

pbar.add(fAmtOut, sBranch);
pbar2.add(fAmt, sBranch);

You may also want to set the colors of each series, soemthing like this:

pbar.colorEach:=false;
pbar2.colorEach:=false;
pbar.Color:=clRed;
pbar2.Color:=clGreen;
iamjoosy