I have a real time feed taking data form an Iot platform, every time a value is received and appended to the plot, in this case every 15 seconds the plot resets to its initial zoom level when it updates.
Is there a way to either stop the graph from zooming out or to record the zoom level so that it can be reset after the update?
Set up for the real time feed:
"refresh": {
"type": "feed",
"transport": "js",
"url": "feed()",
"interval": 15000
},
Accquiring the data and appending to the plot:
// Get new Data
window.feed = function(callback) {
// Issue a get request
$.getJSON('https://www.thingspeak.com/channels//feed.json?callback=?&offset=0&results=1', function(){})
// Upon a successful get request...
.done(function(data){
var p = []
p[0] = p[0] = getChartDate(data.feeds[0].created_at);
p[1] = parseFloat(data.feeds[0].field1);
var newData2 = [p];
// Append values to Graph
$("#myChart").appendSeriesValues({
"values": [newData2]
});
})
}