Page 1 of 1

AV in drawing chart

Posted: Wed Oct 08, 2008 8:03 pm
by 10546565
I am getting an AV in a chart and am not sure what to look at--below is the call stack when it occurs. Any ideas what I might look at?

Edward Dressel

:7c812aeb kernel32.RaiseException + 0x52
:00405984 NotifyNonDelphiException + $1C
:7c90327a ntdll.RtlConvertUlongToLargeInteger + 0x3c
:7c90e46a ntdll.KiUserExceptionDispatcher + 0xe
:0065909a DrawLegendItem + $4AE
:00659403 DrawItems + $83
:0065a31b TCustomChartLegend.DrawLegend + $4FF
:0065575c TCustomChart.DrawTitlesAndLegend + $7C
:0064d77c TCustomAxisPanel.InternalDraw + $C0
:00634468 TCustomTeePanel.Draw + $78
:00634239 TCustomTeePanel.Draw + $21
Controls.TWinControl.PaintHandler((15, 0, 0, 0))
Controls.TWinControl.WMPaint((15, 0, 0, 0))
Controls.TCustomControl.WMPaint(???)
Controls.TControl.WndProc(???)
Controls.TWinControl.WndProc((15, 0, 0, 0, 0, 0, 0, 0, 0, 0))
Controls.TWinControl.MainWndProc(???)
Classes.StdWndProc(265578,15,0,0)
:7e418734 USER32.GetDC + 0x6d
:7e418816 ; C:\WINDOWS\system32\USER32.dll
:7e428ea0 ; C:\WINDOWS\system32\USER32.dll
:7e428eec ; C:\WINDOWS\system32\USER32.dll
:7c90e453 ntdll.KiUserCallbackDispatcher + 0x13
:7e4196c7 USER32.DispatchMessageA + 0xf
Forms.TApplication.ProcessMessage(???)

Posted: Wed Oct 08, 2008 8:17 pm
by 10546565
I fond the problem causing the code-trying to set the index of a series. (See code below).

How do I set the position of a series?

Thanks
Ed Dressel


var
lIdx: integer;

procedure SetSeriesVisible(aSeries: TLineSeries; aVisible: boolean);
begin
if aVisible then
begin
aSeries.ParentChart := chrtRMDValues;
// removing this next line fixed it
chrtRMDValues.SeriesList[lIdx] := aSeries;
inc(lIdx);
end
else
aSeries.ParentChart := nil;
end;

Posted: Thu Oct 09, 2008 8:41 am
by narcis
Hi Ed,

You can use ExchangeSeries method for that as explained here.

Hope this helps!