Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Base Time Unit for Axes Format on CNiGraph

I am graphing many points of data over a time of several days long. I was wondering if there is a way to format the Axes on the Graph to display a base unit of hours instead of days. It is a simple enough task to convert between days and hours, but I find that once the graph reaches the 24th hour it starts displaying time from 0. If I use Integers than the time is displayed like so, (26.75) instead of the preferred display(26:45). I could write a function to convert from decimal format to time format, but I'm not sure how to use this function when setting the format string.

Any help would be greatly appreciated.
0 Kudos
Message 1 of 2
(5,857 Views)
If you look up the FormatString Property for CWAxis in the Measurement Studio Reference, the last paragraph before “Example” is

“With ActiveX controls, the date is implemented as a floating-point value, measuring days from midnight, 30 December 1899. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25. To interpret the time portion, take the absolute value of the fractional part of the number. Thus, 1 second equals 1 / 24 hours / 60 minutes / 60 seconds, which is 1/86400 or approximately 1.157407e-5.”

The point is that as soon as the fractional part of your value goes from about .9999942 to about .9999943 your time will roll from 23:59:59 to 00:00:00, if you are using one of the Date or Time format strings. If you want to stick with a Date or Time format string, “mm/dd/yy hh:nn:ss” might suit your needs best.

Or, you could try using a function like you suggested and display the converted time as a number. That is, once you turn 26.75 into 26.45, display 26.45 as a Number.

I hope this helps.

Eric M
0 Kudos
Message 2 of 2
(5,841 Views)