Recent

Author Topic: [SOLVED] TaChart on MAC: No nice steps anymore...  (Read 849 times)

tk

  • Sr. Member
  • ****
  • Posts: 386
[SOLVED] TaChart on MAC: No nice steps anymore...
« on: February 10, 2026, 11:31:49 am »
Recently I updated Lazarus on my MAC to stable release 4.4. and since then, nice steps in TaChart stopped working. The same program in the same Lazarus version in Windows is OK.
Screenshot on MAC and Windows showing the difference are attached.
Configuration of the LeftAxis is the default.
The same difference appears even when I create fresh app and drop TaChart on the form.
Anyone having similar trouble? Where could be the problem?

MAC: M1 Tahoe 26.2, Lazarus 4.4., FPC  3.3.1.
Win: 25H2, Lazarus 4.4., FPC  3.2.2
Everything installed via Fpcupdeluxe for x86_64 architecture (I still use x86_64 builds on MAC M series).
« Last Edit: February 10, 2026, 10:38:49 pm by tk »

Zvoni

  • Hero Member
  • *****
  • Posts: 3295
Re: TaChart on MAC: No nice steps anymore...
« Reply #1 on: February 10, 2026, 12:43:38 pm »
Have you tried any of the steps mentioned on the Wiki?
https://wiki.freepascal.org/TAChart_documentation#Axis_intervals
Quote
NiceSteps is a string containing a sequence of "step multipliers" -- floating point values in the range from 0 to 1, excluding 0. If this property is applied, the axis step will be a power of ten multiplied by one of the provided values. If several multipliers can be used, the leftmost one will be chosen. Multipliers are separated by the vertical bar (|) character.
Have you explicitely defined "nice steps" as 0.2 (as in your Windows-Screenshot)?
Quote
If NiceSteps is ignored or TAChart fails to find appropriate step, the axis range will be divided into equal intervals without regard to the number of decimal digits in the representation of mark values. In this case, it is recommended to reduce the number of visible digits in Marks.Format.
« Last Edit: February 10, 2026, 12:45:45 pm by Zvoni »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

tk

  • Sr. Member
  • ****
  • Posts: 386
Re: TaChart on MAC: No nice steps anymore...
« Reply #2 on: February 10, 2026, 05:08:43 pm »
Have you tried any of the steps mentioned on the Wiki?
In the project default settings are used for the steps, see attachment.

Have you explicitely defined "nice steps" as 0.2 (as in your Windows-Screenshot)?
The default string for nice steps is used which is 0.2|0.5|1. It contains 0.2 and the step determination behaves as expected on Windows.

The point is that on Windows everything works fine after the Lazarus update, but on MAC not. Linux not tried yet.
The same problem happens even for a fresh app without any change but a TaChart dropped on the form, as I said already.
This IMO should not.

Before the update Lazarus version was 3.99 - some build from trunk - and there was no problem on MAC.
And even for older Lazarus versions I don't remember having such problems with the chart.

wp

  • Hero Member
  • *****
  • Posts: 13397
Re: TaChart on MAC: No nice steps anymore...
« Reply #3 on: February 10, 2026, 05:26:09 pm »
No no, the issue is neither in TAChart, nor Lazarus, nor Mac. The issue is FPC 3.3.1 which has lots of bugs when code is inlined (https://gitlab.com/freepascal.org/fpc/source/-/issues/41581) - and TAChart contains a lot of inline code...

In this specific case, open the unit TACustomSource (in folder components/tachart of your Lazarus installation), and find the function TValuesInRangeParams.CountToStep(ACount: Integer): Double. This function is used by TAChart to calculate the axis labels. Comment out the "inline" after its declaration in the interface part. Rebuild the IDE ("Tools" > "Build Lazarus with Profile..."), and the issue should be gone when the IDE has restarted.

Or install FPC 3.2.2 on your Mac and have Lazarus use it.

Generally, my advice: if possible, do not develop your software based on new features that exist only in FPC/main (3.3.1) - it is too unstable to make your project depend on it. Always use a release version (3.2.2) or the "fixes" version (3.2.3), and check with 3.3.1 only occasionally to be prepared for issues with 3.3.1 (when it should ever be released).
« Last Edit: February 10, 2026, 05:31:04 pm by wp »

tk

  • Sr. Member
  • ****
  • Posts: 386
Re: TaChart on MAC: No nice steps anymore...
« Reply #4 on: February 10, 2026, 06:10:50 pm »
No no, the issue is neither in TAChart, nor Lazarus, nor Mac. The issue is FPC 3.3.1 which has lots of bugs when code is inlined (https://gitlab.com/freepascal.org/fpc/source/-/issues/41581) - and TAChart contains a lot of inline code...
Thanks WP a lot, this will be the cause for sure, will try later.
(I discovered more strange issues eg. with page control, this might be the cause even there.)

Or install FPC 3.2.2 on your Mac and have Lazarus use it.
Unfortunately, installation of FPC 3.2.2 via fpcupdeluxe failed on Sequoia due to this compiler bug https://forum.lazarus.freepascal.org/index.php?topic=69380.15.
(I use fpcupdeluxe installer everywhere.)
So I had to use the trunk.
Looks like I have to try official prebuilt FPC 3.2.2 packages...

EDIT: I give a try to the fixes 3.2.3 as well (hope the Sequoia compiler issue is already fixed there).
« Last Edit: February 10, 2026, 06:14:26 pm by tk »

tk

  • Sr. Member
  • ****
  • Posts: 386
Re: TaChart on MAC: No nice steps anymore...
« Reply #5 on: February 10, 2026, 10:38:25 pm »
I can confirm that installing compiler fixes (branch fixes_3_2) solved the issue with the chart.
(It did not solve the issues with page control where I'll have to investigate further.)

wp

  • Hero Member
  • *****
  • Posts: 13397
Re: [SOLVED] TaChart on MAC: No nice steps anymore...
« Reply #6 on: February 11, 2026, 12:16:09 am »
What's happening with the TPageControl?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12170
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] TaChart on MAC: No nice steps anymore...
« Reply #7 on: February 11, 2026, 12:25:45 pm »
If you issue is/was the "inline" compiler bug (or any other compiler bug).

Than as WP said, use fixes 3.2.3 (or 3.2.2).

But even more, test if your problems happen if you recompile everything with -O-  (all optimizations off).
Everything is
- your project
- The LCL/components of Lazarus
- Any 3rd party stuff
- If you did build fpc yourself, then the RTL/fpc-packages too (otherwise you can keep those as they were)

Because, some of those compiler issues exists in the released 3.2.2 too.
In fixes 3.2.3 some/most(?) have been fixed. But the "inline" one is still there.

The reason why you may not see the bug happen when using those versions with optimization is, that other code is differently optimised, and in that overall different asm code the bug is not triggered, or does not have an effect.


If your code works with all at -O- then that indicates that it may be a compiler issue. However, it is also possible that bugs of your own (e.g. dangling pointer / uninitialised value) change behaviour by that measure. So it needs then further analysis to decide what the issue is.

If the issues happens with -O- then it is rather unlikely (but also not guaranteed) to be one of the (known) compiler issues.

tk

  • Sr. Member
  • ****
  • Posts: 386
Re: [SOLVED] TaChart on MAC: No nice steps anymore...
« Reply #8 on: February 11, 2026, 01:47:26 pm »

tk

  • Sr. Member
  • ****
  • Posts: 386
Re: [SOLVED] TaChart on MAC: No nice steps anymore...
« Reply #9 on: February 11, 2026, 03:02:08 pm »
But even more, test if your problems happen if you recompile everything with -O-  (all optimizations off).

Thanks Martin, I will definitely try it and report.

 

TinyPortal © 2005-2018