Page 1 of 1

Mapping time on Y-axis

Posted: Fri Mar 16, 2012 4:50 am
by 9523580
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.

Re: Mapping time on Y-axis

Posted: Fri Mar 16, 2012 4:06 pm
by yeray
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