/* * @license * chartjs-plugin-streaming * https://github.com/nagix/chartjs-plugin-streaming/ * Version: 1.7.0 * * Copyright 2018 Akihiko Kusanagi * Released under the MIT license * https://github.com/nagix/chartjs-plugin-streaming/blob/master/LICENSE.md */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("chart.js"),require("moment")):"function"==typeof define&&define.amd?define(["chart.js","moment"],t):e["chartjs-plugin-streaming"]=t(e.Chart,e.moment)}(this,function(e,t){"use strict";!function(e,h){var w=e.helpers;w.cancelAnimFrame=function(){if("undefined"!=typeof window)return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){return window.clearTimeout(e)}}();var v=Number.MAX_SAFE_INTEGER||9007199254740991,g={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},y=Object.keys(g);function x(e){for(var t=y.indexOf(e)+1,a=y.length;t=y.indexOf(t);i--)if(o=y[i],g[o].common&&r.as(o)>=e.length)return o;return y[t?y.indexOf(t):0]}(l,a.minUnit,e.min,e.max),e._majorUnit=x(e._unit),e._table=[{time:s,pos:0},{time:r,pos:1}],e._offsets={left:0,right:0},e._labelFormat=function(e,t){var a,n,i,o,r,s,l,u=e.length;for(a=0;a