axis labels

TeeChart for ActiveX, COM and ASP
Post Reply
Axis labels
Newbie
Newbie
Posts: 1
Joined: Thu Sep 01, 2005 4:00 am
Contact:

axis labels

Post by Axis labels » Wed Sep 28, 2005 5:58 pm

Hi,

I'm using Teechart Pro v6, Line graphic.
I have configured de style of the bottom axis to text.
Using the below command I set the label only for the first and the last point:
TChart1.Series(0).AddXY x, y, Text1.Text. vbRed

Because the labels are too long it is cutted by the sides of the component.
The left label should be left justified and the right label right justified.

Is there any property that assigns the alignmet mode?
Is there any possibility to align the labels individualy?

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

Post by Narcís » Thu Sep 29, 2005 10:11 am

Hi,

I'm afraid what you request is not available. TChart1.Axis.Bottom.Labels.Align exists but I'd say this is not what you need. However you can achieve that custom drawing on TChart's canvas:

Code: Select all

Private Sub Form_Load()
    With TChart1.Series(0)
        .Add 12, "", vbRed
        .Add 13, "", vbRed
        .Add 16, "", vbRed
        .Add 11, "", vbRed
        .Add 17, "", vbRed
        .Add 12, "", vbRed
        .Add 17, "", vbRed
        
        .VerticalAxis = aBothVertAxis
    End With
End Sub

Private Sub TChart1_OnAfterDraw()
    Dim First, Last As String
    Dim Offset, CharSize As Integer
    
    First = "First Point Label"
    Last = "Last Point Label"
    Offset = 5
    CharSize = 6
    
    TChart1.Canvas.TextOut TChart1.Axis.Left.Position, _
                            TChart1.Axis.Bottom.Position + Offset, _
                            First
    
    TChart1.Canvas.TextOut TChart1.Axis.Right.Position - Len(Last) * CharSize, _
                            TChart1.Axis.Bottom.Position + Offset, _
                            Last  
End Sub
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