Page 1 of 1

Graph Title position with top custom axis

Posted: Mon Oct 17, 2022 12:59 am
by 16586540
I have a chart that uses both regular and custom axes on all four sides. When there is data for TopAxis, the Chart Title positions correctly, and makes space to show the Top Axis Title and Labels. However, when there is data only for the top custom axis, the chart title overwrites the custom axis title and labels - see the two attached images. When I try to move the Chart Title up, it goes off the top of the chart.

How do I get the Chart Title to recognise the custom axis, and automatically adjust the chart position to allow the Chart Title to be correctly placed.

Thanks in advance

Errol

Re: Graph Title position with top custom axis

Posted: Mon Oct 17, 2022 8:38 am
by yeray
Hello,

This happens because only the default axes "inflate" the chart rectangle.
Here a workaround:

Code: Select all

  if Chart1.Axes.Top.Visible then
     Chart1.MarginTop:=16
  else
     Chart1.MarginTop:=66;