Space between the Left Axis Title and the Chart is Too Big

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Space between the Left Axis Title and the Chart is Too Big

Post by Dave » Mon Mar 23, 2009 4:06 pm

Can I change this from code?

Im setting the left axis title from code thus;

theChart.Axes.Left.Title.Caption = "Voltage";


This displays OK but its too far from the left side of the chart. Id like it to be much closer to the labels on the left-axis. How do I do this?

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 23, 2009 4:34 pm

Hi Dave,

You can have title drawn closer to the labels using Labels.CustomSize property, for example:

Code: Select all

			tChart1.Axes.Left.Labels.CustomSize = 10;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Post by Dave » Mon Mar 23, 2009 4:42 pm

Fantastic. Thanks Narcis.

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Post by Dave » Tue Mar 24, 2009 2:35 pm

Narcis

I was zooming in on the chart with the result that the left axis labels had more digits. This meant they overlapped with the left axis title. I need to be able to position the left axis title depending on how wide the left axis labels are.

ie. The more characters in the left axis labels the large "pos" needs to be.

int pos;

tChart1.Axes.Left.Labels.CustomSize = pos;

Is there an easy way to do this? Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 24, 2009 3:39 pm

Hi Dave,

My colleague Yeray made some examples calculating space dynamically at the forums threads below:

http://www.teechart.net/support/viewtopic.php?t=6146
http://www.teechart.net/support/viewtopic.php?t=5923

Those are TeeChart VCL threads but the same should apply to the .NET version.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply