Page 1 of 1

what happen in Cursor Event?

Posted: Tue Jun 08, 2004 7:54 am
by 9336072

Code: Select all

procedure TFrmChartBase.Cursor2Change(Sender: TCursorTool; x, y: Integer;
  const XValue, YValue: Double; Series: TChartSeries; ValueIndex: Integer);
begin
  if (Series1.Count > 0) and (Series1.XValues.MinValue <= XValue) then
    Annotation1.Text := FormatFloat('#', Series1.YValues[Trunc(XValue)]);
end;
Error of "Access violation at address xxxxxx,Read of address xxxxxx" displays When application runs .

please help me

Posted: Tue Jun 15, 2004 4:33 am
by Marjan
Hi.

Which TeeChart version are you using ? The Trunc[XValue] part looks dangerous to me. Make sure the Trunc[XValue] integer returns valid index value (between 0 and Series.Count-1).

Posted: Thu Jul 01, 2004 3:18 am
by 9336072
yee,I understand
thanks