Recent

Author Topic: TChart margin  (Read 5628 times)

wp

  • Hero Member
  • *****
  • Posts: 11858
TChart margin
« on: July 11, 2011, 11:42:19 pm »
TChart has no adjustable margin between the chart area and the client rect edges. This can cause truncation of long axis labels as shown in the attached screenshot (the x axis maximum should be 1000, but is truncated to 100).

Could you provide a corresponding property to modify the distance between the axes and the border? Optionally it would be great if the length of the outermost axis labels would be taken into account automatically when defining the chart rectangle.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TChart margin
« Reply #1 on: July 12, 2011, 09:18:27 am »
Quote
TChart has no adjustable margin between the chart area and the client rect edges.
Note that BorderSpacing fills similar role, although of course it does not help with truncation issue.

Quote
Could you provide a corresponding property to modify the distance between the axes and the border?
That's easy part, see MarginsExternal since r31672.

Quote
Optionally it would be great if the length of the outermost axis labels would be taken into account automatically when defining the chart rectangle.
That's harder to do. Will think about it.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: TChart margin
« Reply #2 on: July 13, 2011, 12:35:41 pm »
Very nice. MarginsExternal is what I needed. Thank you. Of course, the automatic solution would be fine as well.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TChart margin
« Reply #3 on: July 16, 2011, 08:23:16 pm »
the automatic solution would be fine as well.

Implemented in r31708, r31709, r31712, r31713, r31714.
The code is rather complex, so please test and review if you can.
« Last Edit: July 16, 2011, 08:35:01 pm by Ask »

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: TChart margin
« Reply #4 on: July 17, 2011, 01:04:43 pm »
After playing around a bit, it seems to run prefectly. Excellent! Thank you.

 

TinyPortal © 2005-2018