while not runners_in_race.EOF do begin
cnt := cnt + 1;
selectionid := runners_in_race.FieldByName('selectionid').AsInteger;
placement := runners_in_race.FieldByName('status').AsString;
runner_price_data.params.parambyname('marketid').AsString := marketid;
runner_price_data.params.parambyname('selectionid').AsInteger := selectionid;
edit1.Text := IntToStr(selectionid);
runner_price_data.Prepare;
runner_price_data.Open;
x := 0.0;
Series[cnt] := TLineSeries.Create(Chart1);
Series[cnt].BeginUpdate;
if placement = 'WINNER' then begin
Series[cnt].LinePen.Color := clGreen;
// Series[cnt].SeriesColor:= clGreen ;
// Series[cnt].Pointer.Pen.Color := clGreen ;
end
else if placement = 'LOSER' then begin
Series[cnt].LinePen.Color := clRed;
// Series[cnt].SeriesColor:= clRed ;
// Series[cnt].Pointer.Pen.Color := clRed ;
end
else begin
Series[cnt].LinePen.Color := clPurple;
// Series[cnt].SeriesColor:= clPurple ;
// Series[cnt].Pointer.Pen.Color := clPurple ;
end;
// while not runner_price_data.EOF and (cnt <= length(Series)) do begin
while not runner_price_data.EOF do begin
x := x + 1.0;
backprice := runner_price_data.FieldByName('backprice').AsFloat;
if backprice <= Real(pos) then
Series[cnt].AddXy(x, backprice)
else
Series[cnt].AddXy(x, Real(pos));
runner_price_data.Next;
end;
runner_price_data.Close;
Series[cnt].EndUpdate;
Chart1.AddSeries(Series[cnt]);
runners_in_race.Next;
end;