Page 1 of 1

Label Font Size issue...

Posted: Tue Aug 03, 2004 4:05 pm
by 9079969
I use the following code to add in some labels to the chart

TChart.Axis.Bottom.Labels.Clear
TChart.Axis.Bottom.Labels.Add 1, "Testing"
TChart.Axis.Bottom.Labels.Add 3, "Testing" & vbcr & "testing" & vbcr & "testing"
TChart.Axis.Bottom.Labels.Add 2, "Testing" & vbcr & "testing"
TChart.Axis.Bottom.Labels.Angle = 0

When I add a title though the labels overlap the title.

Using;
TChart.Axis.Bottom.Labels.Font.Size = 20
Does not change the font size of the labels, but will move the bottom axis up and down, so how should I be adding the labels so that they automatically do not overlap?

Thanks

Dominic

Posted: Wed Aug 04, 2004 9:41 am
by Pep
Hi Dominic,
When I add a title though the labels overlap the title.
This can be solved increasin the Size of the Axis labels :
TChart.Axis.Bottom.Labels.Size = 50
TChart.Axis.Bottom.Labels.Font.Size = 20
Does not change the font size of the labels, but will move the bottom axis up and down, so how should I be adding the labels so that they automatically do not overlap?
To increase the font size of the Custom labels you must use similar code to the following

Code: Select all

For i = 0 To TChart.Axis.Bottom.Labels.Count - 1
TChart.Axis.Bottom.Labels.Item(i).Font.Size = 20
Next i
But, as you're using custom labels (and not automatic) in case the labels overlap you will have to find a trick to solve it (like change the angle,...).
Another thing you can do is to use the default axis labels and then use the OnGetAxisLabel event to change the LabelText.