Recent

Author Topic: Label collision on X axis .. currently with TDateTimeIntervalChartSource  (Read 546 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 443
I searched a lot on TAChart Forum Threads, and many of them where helpful,
for example this one: https://forum.lazarus.freepascal.org/index.php?topic=34219.0


I today had "label collisions" when switching from 'hh:mm' to 'hh:mm:ss' on the X axis .. with TDateTimeIntervalChartSource.
 
Then suddenly I thought:  could TAChart itself avoid "label collisions" by calling TextWidth(), anyhow ???
« Last Edit: January 31, 2026, 12:10:16 am by PeterX »
usually using latest Lazarus release version with Windows 10 or 11

wp

  • Hero Member
  • *****
  • Posts: 13409
Re: Label collision on X axis .. currently with TDateTimeIntervalChartSource
« Reply #1 on: January 31, 2026, 12:46:31 am »
Increase the DateTimeIntervalChartSource.Params.MaxLength -this is the maximum distance of labels before the labeller switches to the next unit. I have good experience with values like 100 or 120 (rather than the default value of 50).

PeterX

  • Sr. Member
  • ****
  • Posts: 443
Re: Label collision on X axis .. currently with TDateTimeIntervalChartSource
« Reply #2 on: January 31, 2026, 10:31:50 am »
Increase the DateTimeIntervalChartSource.Params.MaxLength ..
Oh, I see now, I've already set this to 120 long time ago ..

Now when switching from 'hh:mm' to 'hh.mm.ss' I set 150, and this works here.
And back to 120 when I go back to 'hh:mm' .. (happens on zooming in / out with TZoomDragTool)
« Last Edit: January 31, 2026, 10:35:35 am by PeterX »
usually using latest Lazarus release version with Windows 10 or 11

PeterX

  • Sr. Member
  • ****
  • Posts: 443
Re: Label collision on X axis .. currently with TDateTimeIntervalChartSource
« Reply #3 on: February 05, 2026, 11:25:33 am »
Could the component TAChart itself avoid "label collisions" by calling TextWidth(), anyhow ???
usually using latest Lazarus release version with Windows 10 or 11

 

TinyPortal © 2005-2018