How to offsetting the x-axis label in be in the center

TeeChart for ActiveX, COM and ASP
Post Reply
Oblicore
Newbie
Newbie
Posts: 79
Joined: Fri May 27, 2005 4:00 am

How to offsetting the x-axis label in be in the center

Post by Oblicore » Wed Feb 18, 2009 1:08 pm

I need to adjust the label of the x-axis in a report to be centered as depicted in the picture (Pic 1).
This is what I was able to achieve so far with no luck. (Pic2).

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

Post by Yeray » Wed Feb 18, 2009 2:19 pm

Hi Oblicore,

Could you please try this code and see if it works at your end?

Code: Select all

Private Sub Form_Load()
  TeeCommander1.ChartLink = TChart1.ChartLink
  
  TChart1.AddSeries scPoint
  TChart1.Series(0).FillSampleValues 10
  
  TChart1.Aspect.View3D = False
  
  TChart1.Environment.InternalRepaint
End Sub

Private Sub TChart1_OnAfterDraw()
  With TChart1.Axis.Bottom
    .Labels.Clear
    
    For i = .Minimum To .Maximum
      .Labels.Add i + 0.5, Str$(Round(i))
    Next i
  End With
End Sub
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