H
huwei1118
Unregistered / Unconfirmed
GUEST, unregistred user!
请教大家一个问题,我用dbchart和xml语言做了一个条型图(不是3d),为什么Y轴值不能和X轴值的数据对齐。例x轴值的数据是100-105 但他们之间只有4个格子而不是5个 而且y轴的数据本来是在103上的,却不能和x轴的103刻度线对齐,请高手指点下!(我的数据是通过xml传进去的)
代码如下:
//****************************************************************************//
// *通过XML显示图* //
//****************************************************************************//
procedure TCallStatFrm.DrawChar;
var
CallInfoStrings:TStrings;
I,j:Integer;
y:string;
begin
if CallStatView.SelCount>0 then
//CallStatView是listview控件
begin
ShowProcessInfo(LanguageInfo.SubStr[393]);
CallInfoStrings:=TStringList.Create;
try
CallInfoStrings.Add('<?xml version="1.0" standalone="yes"?> ');
CallInfoStrings.Add('<DATAPACKET Version="2.0">');
CallInfoStrings.Add('<METADATA>');
CallInfoStrings.Add('<FIELDS>');
CallInfoStrings.Add('<FIELD attrname="X" fieldtype="i4"/>');
CallInfoStrings.Add('<FIELD attrname="Y" fieldtype="i4"/>');
CallInfoStrings.Add('</FIELDS>');
CallInfoStrings.Add('<PARAMS/>');
CallInfoStrings.Add('</METADATA>');
CallInfoStrings.Add('<ROWDATA>');
for I:=1 to CallStatView.Columns.Count-1do
begin
if CallStatView.Selected.SubItems[I-1]<>'0' then
begin
y:=CallStatView.Selected.SubItems[I-1]+' '+CallStatView.Column.Caption;
CallInfoStrings.Add('<ROW'+' X="'+CallStatView.Column.Caption+'"'+' '+'Y="'+y+'"'+'/>' );
end;
end;
CallInfoStrings.Add('</ROWDATA>');
CallInfoStrings.Add('</DATAPACKET>');
//showmessage(callinfostrings.Text);
CallClientDataSet.Close;
SetSeriesData;
showmessage(callinfostrings.Text);
CallClientDataSet.XMLData:=CallInfoStrings.Text;
CallClientDataSet.Open;
finally
CallInfoStrings.Free;
HideProcessInfo ;
end;
end;
end;
代码如下:
//****************************************************************************//
// *通过XML显示图* //
//****************************************************************************//
procedure TCallStatFrm.DrawChar;
var
CallInfoStrings:TStrings;
I,j:Integer;
y:string;
begin
if CallStatView.SelCount>0 then
//CallStatView是listview控件
begin
ShowProcessInfo(LanguageInfo.SubStr[393]);
CallInfoStrings:=TStringList.Create;
try
CallInfoStrings.Add('<?xml version="1.0" standalone="yes"?> ');
CallInfoStrings.Add('<DATAPACKET Version="2.0">');
CallInfoStrings.Add('<METADATA>');
CallInfoStrings.Add('<FIELDS>');
CallInfoStrings.Add('<FIELD attrname="X" fieldtype="i4"/>');
CallInfoStrings.Add('<FIELD attrname="Y" fieldtype="i4"/>');
CallInfoStrings.Add('</FIELDS>');
CallInfoStrings.Add('<PARAMS/>');
CallInfoStrings.Add('</METADATA>');
CallInfoStrings.Add('<ROWDATA>');
for I:=1 to CallStatView.Columns.Count-1do
begin
if CallStatView.Selected.SubItems[I-1]<>'0' then
begin
y:=CallStatView.Selected.SubItems[I-1]+' '+CallStatView.Column.Caption;
CallInfoStrings.Add('<ROW'+' X="'+CallStatView.Column.Caption+'"'+' '+'Y="'+y+'"'+'/>' );
end;
end;
CallInfoStrings.Add('</ROWDATA>');
CallInfoStrings.Add('</DATAPACKET>');
//showmessage(callinfostrings.Text);
CallClientDataSet.Close;
SetSeriesData;
showmessage(callinfostrings.Text);
CallClientDataSet.XMLData:=CallInfoStrings.Text;
CallClientDataSet.Open;
finally
CallInfoStrings.Free;
HideProcessInfo ;
end;
end;
end;