DataPoints previous values
-
Hi,
Using JAvascript library, how can I return the previous values of a data point. I'm running the following code in my script and i get corect value when i alert the current value but im struggling to see how can i access the historical data, like the value 10 min ago in this script. Can you please guide me? I ahve already looked at the "About Mango Java Script" page but no breakthrough. Thanks.Util.getPointsValues({ done : function(){ chartData = []; alert(res['A1'][0].value); }, scope : res, from : dateRange.start, to : dateRange.end, points : graphPoints, options : { timePeriodType : 'DAYS', timePeriods : 1, rollup : 'AVERAGE' } });
-
Hi arvand,
The functions in "About Mango JavaScript" will work in Mango scripting contexts only, so Scripting data sources, meta data points, point links, etc.
Judging from that snippet, is it part of a dashboard you're designing? If so, you could check out the existing getPointValue.js file in the UI module powering the ma-get-point-value directive, or check out the NodeJS style use of the REST API for point values, here: https://github.com/infiniteautomation/node-mango-client
If it really is in the Mango JavaScript environments, you can
print(p123);
to see the available functions on the context point.