Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

Vinod on Parse the Max/Min value from 1 day to HTMLpage, JSON question.

$
0
0

You could do this in Javascript.

data = $.getJSON("https://api.thingspeak.com/channels/XXXXXX/feeds.json?days=1");

var maxVal = -Infinity;
for (var i = 0; i < data.feeds.length; i++) {
   if (data.feeds[i].field1 > maxVal) {maxVal = data.feeds[i].field1;}
}

maxVal should have the maximum value of field1 in the last day (assuming you have accumulated <8000 points) in the last day.


Viewing all articles
Browse latest Browse all 1833

Trending Articles