Parse the Max/Min value from 1 day to HTMLpage, JSON question. | ThingSpeak API | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Parse the Max/Min value from 1 day to HTMLpage, JSON question.
No permission to create posts
January 14, 2017
3:47 am

Forum Posts: 8
Member Since:
January 8, 2017
sp_UserOfflineSmall Offline

This script works. It prints the 1st value of Field1 in my Channel. The code prints it in the Div class "Column-center".

            $.getJSON("", function(result){

How can I change this so that I insted of the first value get the Max value of the entire 24 hours that I have "getJSON"???

Would love something like:


But I guess its not that simple.


Can anyone help me?

February 26, 2017
4:52 pm

Forum Posts: 215
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

You could do this in Javascript.

data = $.getJSON("");

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.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

James181, kimberlypg2, JamesAdorb, waynesmith, paulettebw60, ashleytb4

Administrators: Hans: 387, lee: 457