Graph Title position with top custom axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Errol
Newbie
Newbie
Posts: 29
Joined: Mon Jul 08, 2019 12:00 am

Graph Title position with top custom axis

Post by Errol » Mon Oct 17, 2022 12:59 am

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
Attachments
TitleIncorrect.jpg
TitleIncorrect.jpg (134.06 KiB) Viewed 5184 times
TitleCorrect.jpg
TitleCorrect.jpg (157.74 KiB) Viewed 5184 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Graph Title position with top custom axis

Post by Yeray » Mon Oct 17, 2022 8:38 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply