Label Font Size issue...

TeeChart for ActiveX, COM and ASP
Post Reply
Cinimod
Newbie
Newbie
Posts: 2
Joined: Thu Nov 27, 2003 5:00 am
Location: UK
Contact:

Label Font Size issue...

Post by Cinimod » Tue Aug 03, 2004 4:05 pm

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Aug 04, 2004 9:41 am

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.

Post Reply