定义:
Series2: TLineSeries
//曲线图
Series1: TBarSeries;
过程:
procedure Tmainform.showtypeClick(Sender: TObject);
begin
if data.showQuery.Active then begin
if showtype.ItemIndex=0 then begin
series2.Active:=false;
series1.Active:=true;
series1.DataSource:=data.showQuery;
series1.XLabelsSource:='题号';
series1.YValues.ValueSource:='正确率(%)';
showdbchart.CheckDatasource(series1);
end else if showtype.ItemIndex=1 then begin
series1.Active:=false;
series2.Active:=true;
series2.DataSource:=data.showQuery;
series2.XLabelsSource:='题号';
series2.YValues.ValueSource:='正确率(%)';
showdbchart.CheckDatasource(series2);
end else begin
showmessage('请选择显示方式!');
end;
end else
showmessage('数据库没有打开!');
end;