Procedure TFrmDamageGraph. BitBtn1Click (Sender: TObject);
Var
Series1: TBarSeries;
The begin
With ADOQueryDamage do
The begin
The close;
SQL. The Clear;
SQL. The Add (' select equ_name, count (equ_name) as summary failure time ');
SQL. The Add (' the from equ_alarm_info ');
SQL. The Add (' where alarm_time between '+ DateToStr (DateTimePicker1. Date));
SQL. The Add (' and '+ DateToStr (DateTimePicker2. Date));
SQL. The Add (' group by equ_name order by summarizing failure time ');
The open;
end;
Series1. The DataSource:=ADOQueryDamage;
Series1. XLabelsSource:='device name;
Series1. YValues. ValueSource:='summary failure time;
end;
The dynamic loading of SQL statements need to set the DataSource in the Editing?
CodePudding user response:
I don't use Chart, DBChart, ha haCodePudding user response:
When designing a datasource to try the datasetCodePudding user response:
Use DBChart convenient, but not easy to generate special type of Chart diagram, it is recommended to use Chart,