what happen in Cursor Event?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Jilonger.Xusen
Newbie
Newbie
Posts: 11
Joined: Mon Mar 08, 2004 5:00 am
Contact:

what happen in Cursor Event?

Post by Jilonger.Xusen » Tue Jun 08, 2004 7:54 am

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

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Jun 15, 2004 4:33 am

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).
Marjan Slatinek,
http://www.steema.com

Jilonger.Xusen
Newbie
Newbie
Posts: 11
Joined: Mon Mar 08, 2004 5:00 am
Contact:

Post by Jilonger.Xusen » Thu Jul 01, 2004 3:18 am

yee,I understand
thanks

Post Reply