TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Jilonger.Xusen
- Newbie
- Posts: 11
- Joined: Mon Mar 08, 2004 5:00 am
-
Contact:
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
- 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).