getTimeUnits Method

Purpose:

Returns an educated guess at what units should be used to display a graph nicely without crowding..

Syntax:

getTimeSpanUnits(span)

Comments: 

The return value will be 1 , 60, 3600, 86400, 604800 or 31536000,  seconds,minutes,hours,days,weeks,years

Note there is no month setting. This is becuase months have a variable number of days.

 

Example:

 

timespan = hdb.GetTimeSpan(sch) // use schedule if activated
units = gettimespanunits(timespan) // will be 1 , 60, 3600, 86400, 604800 or 31536000
// you can use your own determination for units