Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFValues.PlotValues Method

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFValues.PlotValues Method
Reduces the number of values over the specified time range to minimum necessary for producing an accurate trend over the number of intervals (typically represents pixels).

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public AFValues PlotValues(
	AFTimeRange timeRange,
	int intervals
)
Public Function PlotValues ( 
	timeRange As AFTimeRange,
	intervals As Integer
) As AFValues

Dim instance As AFValues
Dim timeRange As AFTimeRange
Dim intervals As Integer
Dim returnValue As AFValues

returnValue = instance.PlotValues(timeRange, 
	intervals)
public:
AFValues^ PlotValues(
	AFTimeRange timeRange, 
	int intervals
)
member PlotValues : 
        timeRange : AFTimeRange * 
        intervals : int -> AFValues 

Parameters

timeRange
Type: OSIsoft.AF.TimeAFTimeRange
The bounding time range for the plot values request.
intervals
Type: SystemInt32
The number of intervals to plot over. Typically, this would be the number of horizontal pixels in a horizontal trend.

Return Value

Type: AFValues
Returns an AFValues collection with values that will produce the most accurate plot over the time range while minimizing the amount of data returned.

Exceptions

ExceptionCondition
ArgumentOutOfRangeException The intervals must be greater than one.
InvalidOperationException The exception is thrown if the Attribute in AFValues is null, or if the Timestamp in AFValues list are not monotonic.

Remarks

This method is a client side calculation on the AFValues collection previously retrieved.

For each interval, the data available is examined and significant values are returned. Each interval can produce up to 5 values if they are unique, the first value in the interval, the last value, the highest value, the lowest value and at most one exceptional value (bad status or digital state).

For performance reason, this method assumes that events (timestamp) in AFValues are in order (monotonic), either in forward or reverse direction. The user can programmatically utilize the default extension method to AFValues if the events are not in order.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in