AnsweredAssumed Answered

AFSDK PlotValues Issue - Returns too much data

Question asked by mark.omeara on Apr 20, 2018
Latest reply on May 24, 2018 by cmanhard



I may be missing something very obvious, but it seems the PlotValues method is returning too much data.

I have an AFListData where I want to plot the values of a collection of attributes in a trend over a time range, hence the 'PlotValues' method of that class seems appropriate. I will use one of these attributes as an example, a pressure reading.


Lets say the chart is 500px wide which I shall hard code for demonstration sake in the code below:


                var pg = new PIPagingConfiguration(PIPageType.TagCount, 100);

                var tr = new AFTimeRange(new AFTime(StartDate), new AFTime(EndDate));

                var listResults = afList.Data.PlotValues(tr, 500, pg);


If I look at the returned AFValues for the pressure reading attribute it has returned about 1200 values - more than can be reasonably displayed on a 500 pixel area.

What am I doing wrong here?


Using Osisoft.AFSDK.dll ver


Below is a comparison between the PlotValues call and the PI System Explorer trend (note I have set the intervals to 500 there). The PI Point is the same one, but different results.

Chart from PlotValues callExpected result from same PI Point as displayed in System Explorer
AFSDK - Chart with 500 intervals.JPGPI Explorer - Chart with 500 intervals.JPG