Recent

Author Topic: acces violation when resetting Tradialseries after zooming [SOLVED]  (Read 785 times)

bbd666

  • New Member
  • *
  • Posts: 14
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);
« Last Edit: March 04, 2024, 10:41:53 am by bbd666 »

wp

  • Hero Member
  • *****
  • Posts: 11989
Re: acces violation when resetting Tradialseries after zooming
« Reply #1 on: March 03, 2024, 02:22:26 pm »
Please post a small project showing the issue.

bbd666

  • New Member
  • *
  • Posts: 14
Re: acces violation when resetting Tradialseries after zooming
« Reply #2 on: March 04, 2024, 08:26:34 am »
Here it is.
Thks for your reply.

wp

  • Hero Member
  • *****
  • Posts: 11989
Re: acces violation when resetting Tradialseries after zooming
« Reply #3 on: March 04, 2024, 10:18:02 am »
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  [Select][+][-]
  1. procedure TPolarSeries.Draw(ADrawer: IChartDrawer);
  2. [...]
  3. var
  4.   j: Integer;
  5. begin
  6.   if IsEmpty or (not Active) then exit;
  7.   PrepareAngleCache;    // <------ TO BE ADDED
  8.   originPt := ParentChart.GraphToImage(DoublePoint(OriginX, OriginY));
  9.   fill := FFilled and (FBrush.Style <> bsClear);  
  10.   [...]

 
« Last Edit: March 04, 2024, 10:23:07 am by wp »

bbd666

  • New Member
  • *
  • Posts: 14
Re: acces violation when resetting Tradialseries after zooming
« Reply #4 on: March 04, 2024, 10:41:35 am »
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.

 

TinyPortal © 2005-2018