Man Without Face
Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору dbChart1.SeriesList.Clear; //Очищаю график begin //Подсчитываю количество линий: count_product:=0; while not(qCharts.Eof) do begin inc(count_product); SetLength(mproduct,count_product); mproduct[count_product-1]:=qCharts.FieldByName('rc_smenavol_volumenum').AsInteger; qCharts.Next; end; //Строю график qChart2.Open; for i:=0 to count_product-1 do begin SetLength(mseries,dbChart1.SeriesList.Count+1); mseries[dbChart1.SeriesList.Count]:=TFastLineSeries.Create(dbChart1); mseries[dbChart1.SeriesList.Count].LinePen.Width:=2; dbChart1.AddSeries(mseries[dbChart1.SeriesList.Count]); j:=Trunc(cxdedReservFrom.Date); while j<=Trunc(cxdedReservTo.Date) do begin if (qChart2.FieldByName('rc_smenavol_volumenum').AsInteger = mproduct[i])and(trunc(qChart2.FieldByName('rc_sd_begindate').AsDateTime)=j) then begin if cxRadioGroup1.ItemIndex = 0 then begin //График фактического отклонения движения за смену от расчетного mseries[dbChart1.SeriesList.Count-1].Add(qChart2.FieldByName('otklon_fakdvforsmena').AsInteger,DateToStr(j)); end else begin //График фактического остатка от нарастающего расчетного mseries[dbChart1.SeriesList.Count-1].Add(qChart2.FieldByName('otklon_fakrestfromincrease').AsInteger,DateToStr(j)); end; mseries[dbChart1.SeriesList.Count-1].SeriesColor:=qChart2.FieldByName('producttypes_color').AsInteger; mseries[dbChart1.SeriesList.Count-1].Title:=qChart2.FieldByName('producttypes_productname').AsString + ' ('+ qChart2.FieldByName('rc_smenavol_volumenum').AsString + ' резервуар)'; qChart2.Next; end else begin j:=j-1; qChart2.Next; end; inc(j); end; end; end; |