AddTimePeriod method (XY Plot object)

Adds a new time period to the runtime chart. Time periods may be specified in one of two ways: as an absolute time period between two specified dates and times or as a specified number of seconds, minutes, or hours relative to the current time.
Syntax
XYPlot1
.
AddTimePeriod
start
,
end
where
XYPlot1
- is the name of an XY Plot object or an expression that evaluates to an XY Plot object.
start
– is a parameter of the type String. If an absolute time period is desired, then this will be a date/time string such as "
2016/01/01 12:00 PM
". If a relative time period is desired then this string must be set to "
REL
".
end
– is a parameter of the type String. If an absolute time period is desired, then this will be a date/time string such as "
2016/02/01 12:00 PM
". If a relative time period is desired then this string represents the relative amount of time from the current time.
Relative times are specified in the format
sNu
()
where:
  • s
    - direction. Only "
    " (minus sign) is supported.
  • N -
    duration.
  • u
    - duration units.
    s
    means seconds,
    m
    means minutes, and
    h
    means hours.
Examples of relative times:
  • -10m()
    : means last ten minutes
  • -2h()
    : means last two hours
  • -168h()
    : means last week
Example
Private Sub btnAddTimePeriod() Rem Add an absolute time period. XYPlot1.AddTimePeriod "2016/01/01 09:15 AM", "2016/02/01 10:00:05 PM" Rem Add a relative time period for the last ten minutes. XYPlot1.AddTimePeriod "REL", "-10m()" End Sub
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal