Mapping time on Y-axis

TeeChart for ActiveX, COM and ASP
Post Reply
Seth
Newbie
Newbie
Posts: 92
Joined: Tue Aug 17, 2004 4:00 am

Mapping time on Y-axis

Post by Seth » Fri Mar 16, 2012 4:50 am

Hi

I use TeeChart ActiveX ver.7,0,1,4.

I want to map time such as hour, minute, and second onto Y-axis.

Look at this Chart, please. (This is not TeeChart)
There are time data on Y-axis.
Image

I use Add(), AddNull() and AddXY() api for mapping data.

Is there API that is used mapping time data on Y-axis?

I'll wait for your answer.

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

Re: Mapping time on Y-axis

Post by Yeray » Fri Mar 16, 2012 4:06 pm

Hi Seth,

According to msdn I'd say the following should work:

Code: Select all

TChart1.Axis.Left.Labels.DateTimeFormat = "nn''ss'"
However it doesn't seem to work as I'd expect. Anyway, I've been able to work around it setting DateTimeFormat to "nn:ss'" and replacing the ":" for "''" (and adding "'" at the end of the string) at OnGetAxisLabel:

Code: Select all

  TChart1.Axis.Left.Labels.DateTimeFormat = "nn:ss"
'...
Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
  If Axis = 0 Then ' zero corresponds to the Left axis
    LabelText = Replace$(LabelText, ":", "''") + "'"
  End If
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