Recent

Author Topic: Cluttered line chart X axis  (Read 1490 times)

JD

  • Hero Member
  • *****
  • Posts: 1913
Cluttered line chart X axis
« on: April 27, 2020, 06:49:30 pm »
Hi there everyone,

After solving the cluttered Y axis problem https://forum.lazarus.freepascal.org/index.php/topic,49396.0.html, I now have a line chart that I would like to show up to 36 months of data on the X axis. The problem is that the year/month labels of the X-axis begin to overlap. See screenchot.

Is there a setting or anything else I can do to get around the overlapping?

Thanks a lot for your assistance.

JD
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Cluttered line chart X axis
« Reply #1 on: April 27, 2020, 07:02:08 pm »

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: Cluttered line chart X axis
« Reply #2 on: April 27, 2020, 07:43:15 pm »
The parameter to tune the spacing between axis marks is the MaxLength parameter of the Intervals property of the axis - this is the maximum distance between adjacent ticks (in pixels). When the size of the chart increases so that the same tick distance would increase the axis switches to the next unit as specified by the NiceSteps values.

This works also when the default axis scaling is bypassed by using the DateTimeIntervalChartSource. In this case, the property with the same effect is called "Params". So, in summary, you must increase the Params.Maxlength property of the DateTimeIntervalChartSource to something like 100 (default is 50).

Alternatively you can also rotate the labels.

 

TinyPortal © 2005-2018