Skip to content

Commit

Permalink
Added timeoffset calculation for realtime charts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstocker committed Jan 22, 2018
1 parent 1f5bed4 commit 65d3722
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@

var doUpdate = function() {


if(data.length > n-1){
data.shift();
}
Expand Down Expand Up @@ -326,6 +325,11 @@

plot1.series[0].data = data;
options.axes.xaxis.min = data[0][0];

if(data[0][0] > data[data.length-1][0]) {
options.axes.xaxis.min = x - (n-1)*t;
}

options.axes.xaxis.max = data[data.length-1][0];
plot1 = $.jqplot (plotAreaId, [data],options);
setTimeout(doUpdate, t);
Expand Down

0 comments on commit 65d3722

Please sign in to comment.