开发者

how to set my graph to be side bar graph

开发者 https://www.devze.com 2023-01-12 11:44 出处:网络
while not sqlDebtors.eof do begin fAmtOut := 0; fAmt := 0; sBranch := sqlDebtors.fieldbyname(\'Branch\').AsString;

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

how to set my graph to be side bar graph

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

how to set my graph to be side bar graph

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号