Can you help? Want to add sunset / sunrise to chart | ThingSpeak Plugins | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Can you help? Want to add sunset / sunrise to chart
Avatar
markswift
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
January 14, 2015 - 1:59 pm
sp_Permalink sp_Print

Hello,

I'm trying to add a sunrise and sunset overlay to the multiple feed chart example. My aim is to end up with something like this: http://pi.tafkas.net/temperatures/

I've found the code here: http://warlord.no-ip.com/howto.html

Specifically:

options.xAxis.plotBands = []
for (var i = 31; i >= 0; i--) {
var d = new Date();
d.setHours(0,0,0,0);
d.setDate(d.getDate()-i);
var sunrise = d.getTime()+computeSunrise(dayOfYear(), true);
var sunset = d.getTime()+computeSunrise(dayOfYear(), false);
options.xAxis.plotBands.push({
from: sunrise,
to: sunset,
color: '#FCFFC5'
});
};

Does anyone have any idea how to integrate this into the example multi chart plugin?

Thank you in advance,

Mark

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: cstapels
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

yeseniara11

RomanFug

JamesPes

RobertBak

ScottSmiva

Amourhotte

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee