dbchart

procedure TForm1.Button1Click(Sender: TObject);
var

//  series1:TBarSeries;
//  series2:TPieSeries;
//  series3:TAreaSeries;
//  series4:TCircledSeries;
//  series5:TFastLineSeries;
  myseries:TBarSeries;
begin
  with ADOQuery1 do
  begin
    close;
    sql.Clear;
    SQL.Text:='select 客户编号,sum(订单数量) 订单数量 from lsddbiao group by 客户编号';
    Open;
  end; 

  DBChart1.View3D:=false;
  DBChart1.FreeAllSeries;
  myseries:= TBarSeries.Create(self);
  With myseries do
  begin
    ParentChart := DBChart1;
    marks.Style:= smsvalue;
    DataSource := ADOQuery1;
    XLabelsSource :='客户编号';
    YValues.ValueSource :='订单数量';
  end;
end; 

你可能感兴趣的:(chart)