8:12 am

May 25, 2018

hello I want to help connect the timeline chart with thingspeak JSON. An example: when the value is 1234567 IN, then the timeline is a bream line. when the 1234567 OUT stops the cut line and calculates how long the line is. I'll give you a code and a link to JSON:
https://api.thingspeak.com/channels/463450/feeds.json?api_key=VAL3TD2W5LADX7K1&results=5
SCRIPT:
https://www.gstatic.com/charts/loader.js
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('example5.1');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Room' });
dataTable.addColumn({ type: 'string', id: 'Name' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Darbuotojas1', 'Viduje', new Date(0,0,0,12,0,0), new Date(0,0,0,13,30,0) ],
[ 'Darbuotojas2', 'Isoreje', new Date(0,0,0,14,0,0), new Date(0,0,0,15,30,0) ],
[ 'Darbuotojas3', 'Viduje', new Date(0,0,0,16,0,0), new Date(0,0,0,17,30,0) ],
[ 'Darbuotojas4', 'Isoreje', new Date(0,0,0,12,30,0), new Date(0,0,0,14,0,0) ],
[ 'Darbuotojas5', 'Viduje', new Date(0,0,0,14,30,0), new Date(0,0,0,16,0,0) ],
[ 'Darbuotojas+', 'Viduje', new Date(0,0,0,16,30,0), new Date(0,0,0,18,0,0) ]]);
var options = {
timeline: { colorByRowLabel: true }
};
chart.draw(dataTable, options);
}
Most Users Ever Online: 166
Currently Online:
26 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, huldacormierModerators: cstapels: 460
Administrators: Hans: 405, lee: 457