我用的是chart,代码如下
Series1.Clear;
with AdoDataSet1 do begin
Close;
CommandText := 'Select 文化程序 ,Count(*) as ZS From 人员表 Group by 文化程序';
Open;
if IsEmpty = False then
begin
First;
while not EOF do begin
if FieldByName('文化程序').IsNull = False then
begin
Series1.Add(FieldByName('zs').AsInteger, FieldByName('文化程序').AsString);
end;
Next;
end; //while
end;
Close;
end; //w