Bottom axis labels

TeeChart for ActiveX, COM and ASP
Post Reply
Rossmc
Newbie
Newbie
Posts: 23
Joined: Thu Mar 30, 2006 12:00 am

Bottom axis labels

Post by Rossmc » Fri Jun 27, 2008 7:28 am

Hi

I was certain there was a way to align bottom axis labels (custom) labels. In effect I need the label to draw on the right of the tick, not centered under it?

Still plodding along with version 7 (latest).

Thanks

EDIT: Just encountered something else. Is it possible to draw the grid lines on top of the Area series?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Jun 30, 2008 8:44 am

Hi Rossmc,

I think that in this demo there is achieved something very similar than what you are looking for:

Code: Select all

Private Sub Form_Load()
  With TChart1.Series(0)
    .Clear
    .Add 123, "First", clTeeColor
    .Add 456, "Second", clTeeColor
    .Add 321, "Third", clTeeColor
    .Add 234, "Last", clTeeColor
  End With
End Sub


Private Sub TChart1_OnDrawAxisLabel(ByVal Axis As Long, ByVal X As Long, ByVal Y As Long, LabelText As String)
  With TChart1
    If Check1.Value Then
      If Axis = 0 Then
        If X = TChart1.Axis.Bottom.CalcXPosValue(TChart1.Axis.Bottom.Minimum) Then  '  first label
         .Canvas.Font.Bold = True
         .Canvas.TextAlign = ctaLeft
        Else
          If X = TChart1.Axis.Bottom.CalcXPosValue(TChart1.Axis.Bottom.Maximum) Then ' last label
           .Canvas.Font.Bold = True
           .Canvas.TextAlign = ctaRight
          Else
           .Canvas.Font.Bold = False
          End If
        End If
      End If
    End If
  End With
End Sub
And, if I understand you second question, I think you are looking for this:

Code: Select all

TChart1.Axis.DrawAxesBeforeSeries = False
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply