门店对比
procedure TF250324.CreateFastLines;
var
i: Integer;
lcs:TFastLineSeries;
const
lr: array[0..8] of TColor = (clred, clGreen, clPurple, cllime,clBlue , clBlack, clskyblue, clMaroon, clYellow);
begin
inherited;
if MemReport.IsEmpty then
Exit;
//画走势图
cht1.SeriesList.Clear;
cht1.Title.Text.Text := formatDateTime('yyyy-mm-dd', dtpBgDATE.Date) + '至' + formatDateTime('yyyy-mm-dd', dtpEndDATE.Date) + '[客人入住预测走势图]';
for i := 0 to cbBid.Items.Count - 1 do
begin
if i = cbBid.Items.Count - 1 then Continue;
lcs := TFastLineSeries.Create(cht1);
lcs.Title := cbBid.Items[i];
lcs.Marks.Style := smsvalue;
lcs.LinePen.Width := 3;
lcs.Marks.Arrow.Visible := True;
lcs.Marks.Callout.ArrowHead := ahSolid;
lcs.Marks.Callout.ArrowHeadSize := 12;
lcs.Marks.Visible := True;
lcs.SeriesColor := lr[i];
cht1.AddSeries(lcs);
end;
cht1.Width := 1920;
cht1.Height := 700;
if MemReport.RecordCount > 60 then
cht1.Width := 40 * MemReport.RecordCount;
with MemReport do
begin
DisableControls;
First;
while not eof do
begin
for i := 0 to cbBid.Items.Count - 1 do
begin
if i = cbBid.Items.Count - 1 then Continue ;
// cht1.SeriesList.Items[i].AddY(FieldByName('总入住数量').AsInteger, FormatDateTime('m.d', FieldByName('日期').AsDateTime), cht1.SeriesList.Items[i].SeriesColor)
cht1.SeriesList.Items[i].AddY(FieldByName(cbBid.Items[i] + '入住数量|总数').AsInteger, FormatDateTime('m.d', FieldByName('日期').AsDateTime), cht1.SeriesList.Items[i].SeriesColor);
end;
next;
end;
First;
EnableControls;
end;
//
// for i := 1 to 31 do
// begin
// lcs.AddY(MemReport.FieldByName(IntToStr(i)).AsFloat, 'D' + IntToStr(i), clRed);
// end;
cht1.Visible := True;
end;