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('Outstan开发者_如何学JAVAding').asfloat; fAmt := fAmt + sqlDebtors.fieldbyname('Amount').asfloat; sqlDebtors.Next; end; pbar.add(fAmtOut, sBranch); pbar.add(fAmt, sBranch); end;
my graph draw like this
but i want to group my graph to be side bar graph so its can group by branch like this:
hope anyone can help me.thanks.
Try:
pBar.MultiBar := mbSide;
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;
精彩评论