Page 1 of 1

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

Posted: Mon Mar 23, 2009 4:06 pm
by 13050364
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.

Posted: Mon Mar 23, 2009 4:34 pm
by narcis
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;

Posted: Mon Mar 23, 2009 4:42 pm
by 13050364
Fantastic. Thanks Narcis.

Posted: Tue Mar 24, 2009 2:35 pm
by 13050364
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.

Posted: Tue Mar 24, 2009 3:39 pm
by narcis
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!