Animated Chart | ThingSpeak API | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.
Avatar

Please consider registering
Guest

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
Animated Chart
No permission to create posts
April 2, 2011
1:01 pm
Avatar
roebuj
Philadelphia, PA
New Member
Members
Forum Posts: 3
Member Since:
April 2, 2011
sp_UserOfflineSmall Offline

I’m unable to locate any information on how to generate an animated graph similar to Dynamic Light Levels graph on the main page.  Any guidance would be greatly appreciated.

April 2, 2011
2:46 pm
Avatar
Hans
Natick, MA

Admin
Forum Posts: 411
Member Since:
January 18, 2011
sp_UserOfflineSmall Offline

Here's what we do to generate the chart on our home page:

 

1) We load up the last 15 entries on the channel and draw the chart

https://api.thingspeak.com/channels/9/field/1.json?callback=?&results=15

 

2) After 15 seconds we request, the "last" entry in the channel and update the chart if the last entry is new

https://api.thingspeak.com/channels/9/feed/last.json?callback=?

 

If you view the source of our home page, we have the process documented. You can use a ThingSpeak Plugins to make your own version with your own data.

 

Let us know if you have anymore question. Have fun!

 

 

April 2, 2011
3:01 pm
Avatar
roebuj
Philadelphia, PA
New Member
Members
Forum Posts: 3
Member Since:
April 2, 2011
sp_UserOfflineSmall Offline

I did view the source, thanks for the info!  I'll see what I can make of it.

 

Thanks!

April 3, 2011
9:05 pm
Avatar
roebuj
Philadelphia, PA
New Member
Members
Forum Posts: 3
Member Since:
April 2, 2011
sp_UserOfflineSmall Offline
April 8, 2011
5:41 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

We made this easier for you, when you use the iframe embed code just put &dynamic=true on the end of the src attribute.  It should look something like this:

<iframe width="450" height="250" style="border: 1px solid #cccccc;" src="https://api.thingspeak.com/channels/9/charts/1?round=2&results=15&dynamic=true"></iframe>

April 12, 2011
4:43 am
Avatar
Australian Robotics
Australia
New Member
Members
Forum Posts: 3
Member Since:
April 12, 2011
sp_UserOfflineSmall Offline

I noticed the &dynamic=true option expands the graph (and compresses the data) and doesn't actually scroll the time range like the homepage chart-- anyway to make this another parameter or the default behaviour?

April 12, 2011
8:04 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

You're right that should be the default behavior.  It's changed now.  To prevent data from being pushed off the left side of the chart you can add &push=false as a querystring parameter.

April 12, 2011
4:27 pm
Avatar
Australian Robotics
Australia
New Member
Members
Forum Posts: 3
Member Since:
April 12, 2011
sp_UserOfflineSmall Offline

Thanks lee, that works great now! Very nice charts btw.

 

 

May 13, 2011
9:42 am
Avatar
Afulki
USA
New Member
Members
Forum Posts: 1
Member Since:
May 13, 2011
sp_UserOfflineSmall Offline

Auto updates don't seem to work when the chart is embedded in the iframe_loader in Wordpress, any thoughts?

May 13, 2011
4:05 pm
Avatar
Hans
Natick, MA

Admin
Forum Posts: 411
Member Since:
January 18, 2011
sp_UserOfflineSmall Offline

Can you provide the chart URL you are using? "dynamic=true" must be on the Chart API URL.

The demo is live on our documentation using the iframe_loader plugin.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormier

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457