Forum > TAChart

acces violation when resetting Tradialseries after zooming [SOLVED]


I'm using one Tchart with one radialseries
I can create the series in runtime and resetting it with .clear and .addXY, it works fine.
But when just before resetting the series I zoomed it with the Mouse I get an external access violation error pointing to :
unit TARadialSeries
line 1415 :    Result := DoublePoint(r * FCos + OriginX, r * FSin + OriginY);

Please post a small project showing the issue.

Here it is.
Thks for your reply.

Fixed in main.

If you don't use Laz/main you can patch your own version easy:

* Make a backup copy of file taradialseries.pas (in components/tachart of your Lazarus installation)
* Load unit TARadialSeries into the IDE, find the implementation of procedure TPolarSeries.Draw, scroll down a but until you see the "begin" of the procedure body (there are several nested procedures above it).
* After "if IsEmpty or (not Active) then exit;" add the line "PrepareAngleCache;"
* Save. When you compile your project the next time, TAChart should be rebuilt automatically, and the error should be gone then. If the error still exists, go to "Tools" > "Configure Build Lazarus", check "Clean All" and "After building switch to automatically" and click "Build" to do a clean rebuild of the entire IDE.
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TPolarSeries.Draw(ADrawer: IChartDrawer);[...]var  j: Integer;begin  if IsEmpty or (not Active) then exit;  PrepareAngleCache;    // <------ TO BE ADDED  originPt := ParentChart.GraphToImage(DoublePoint(OriginX, OriginY));  fill := FFilled and (FBrush.Style <> bsClear);    [...]

Great !
Thanks again.
I really appreciate you spent time explaining in details how to fix the issue in older versions, although you had already fixed it in more recent upgrades.


[0] Message Index

Go to full version