procedure TFMBZBT.RadioButton1Click(Sender: TObject);
var
bars:TpieSeries;
sqlstr:string;
begin
bars:=Tpieseries.Create(dbchart1);
dbchart1.AddSeries(bars);
dbchart1.Series[0].ColorEachPoint:=True; //数据块不同色
try
case Tcomponent(sender).Tag of
0:
begin
sqlstr:='select yblb,count(*) from INPATIENT_INFO group by yblb';
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='yblb';
end;
1:
begin
sqlstr:='select doc_result,count(*) from INPATIENT_INFO group by doc_result';
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='doc_result';
end;
end;
adobt.Close;
adobt.SQL.Clear;
adobt.SQL.add(sqlstr);
adobt.Open;
dbchart1.AutoRefresh:=false;
dbchart1.AutoRefresh:=true;
dbchart1.Series[0].Active:=false;
DBChart1.Series[0].DataSource:=adobt;
dbchart1.Series[0].Active:=true;
except
showmessage('没有数据可以过滤');
end;end;
这个语句实现的是,如下图:
点选这两个选项,可以出现对应的饼图。问题:一开始点一个没问题,可以出现对应的饼图。可是再点第二个就出现了如下图的错误提示:
var
bars:TpieSeries;
sqlstr:string;
begin
bars:=Tpieseries.Create(dbchart1);
dbchart1.AddSeries(bars);
dbchart1.Series[0].ColorEachPoint:=True; //数据块不同色
try
case Tcomponent(sender).Tag of
0:
begin
sqlstr:='select yblb,count(*) from INPATIENT_INFO group by yblb';
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='yblb';
end;
1:
begin
sqlstr:='select doc_result,count(*) from INPATIENT_INFO group by doc_result';
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='doc_result';
end;
end;
adobt.Close;
adobt.SQL.Clear;
adobt.SQL.add(sqlstr);
adobt.Open;
dbchart1.AutoRefresh:=false;
dbchart1.AutoRefresh:=true;
dbchart1.Series[0].Active:=false;
DBChart1.Series[0].DataSource:=adobt;
dbchart1.Series[0].Active:=true;
except
showmessage('没有数据可以过滤');
end;end;
这个语句实现的是,如下图:
点选这两个选项,可以出现对应的饼图。问题:一开始点一个没问题,可以出现对应的饼图。可是再点第二个就出现了如下图的错误提示:
解决方案 »
- 360个拉圾刚写好的程序放到U盘运行被阻止了
- 新人求教奇怪问题。
- 关于多个ClientSocket对应ServerSocket文件的并发传输
- 请问API函数GetComputerName在Delphi中怎么用,那两个参数对应的Delphi类型是什么,怎么用,怎么我经常报告错误呢,急着用,请各位高手剁
- 急!!计算机接通电源后什么反映也没有,硬盘不读,显示器不响应,主板不报警,我将显卡和内存反复插n遍以后,亮过一次,再加一根内存又
- 一个表单的问题
- 我想让一个其它的程序的窗口始终在最顶层,不被其它窗口覆盖,如何发消息。
- 那位有DELPHI的系统托盘控件,发我一个吧?
- 请接分:newwen(玩一会儿) 、 qybao(阿宝) cipherliu(孤鹰) plainsong(轻风) renzhm(戴尔飞)
- 求助:这样的指针需要释放吗?如果要的话,是怎么释放的?
- TclientSocket/tServerSocket连接外网
- delphi 用excel打开txt
dbchart1.Series[0].DataSource:=nil;
DBChart1.Series[0].DataSource:=adobt;
貌似还是不行……
var
bars:TpieSeries;
sqlstr:string;
begin
bars:=Tpieseries.Create(dbchart1);
dbchart1.AddSeries(bars);
dbchart1.Series[0].ColorEachPoint:=True; //数据块不同色
dbchart1.Series[0].Active:=false;
adobt.Close;
adobt.SQL.Clear;
try
case Tcomponent(sender).Tag of
0:
begin
dbchart1.Series[0].DataSource:=nil;
sqlstr:='select yblb,count(*) from INPATIENT_INFO group by yblb';
adobt.SQL.add(sqlstr);
adobt.Open;
DBChart1.Series[0].DataSource:=adobt;
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='yblb';
dbchart1.Series[0].Active:=true; //打开dbchart
end;
1:
begin
dbchart1.Series[0].DataSource:=nil;
sqlstr:='select doc_result,count(*) from INPATIENT_INFO group by doc_result';
adobt.SQL.add(sqlstr);
adobt.Open;
DBChart1.Series[0].DataSource:=adobt;
bars.PieValues.ValueSource:='count(*)';
bars.XLabelsSource:='doc_result';
dbchart1.Series[0].Active:=true; //打开dbchart
end;
end;
except
showmessage('没有数据可以过滤');
end;end;