Home > Back-end >  Delphi7 USES DBChart display graphics
Delphi7 USES DBChart display graphics

Time:10-12

Masters, the younger brother recently wanted to use a chart showing the selected period of time when the number of equipment failure, with DBChart components showed no graphics, don't know where is wrong, the following post code, bother everybody to help me to analyse the, thank you very much ~ ~ ~
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 ha

CodePudding user response:

When designing a datasource to try the dataset

CodePudding user response:

Use DBChart convenient, but not easy to generate special type of Chart diagram, it is recommended to use Chart,
  • Related