template.js.flot.jquery.flot.time.min.js Maven / Gradle / Ivy
/*
Pretty handling of time axes.
Set axis.mode to "time" to enable. See the section "Time series data" in API.txt
for details.
*/
(function(a){var i={};function d(k,j){return j*Math.floor(k/j)}function h(q,l,o,k){if(typeof q.strftime=="function"){return q.strftime(l)}var u=function(w,r){w=""+w;r=""+(r==null?"0":r);return w.length==1?r+w:w};var j=[];var v=false;var t=q.getHours();var p=t<12;if(o==null){o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}if(k==null){k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}var m;if(t>12){m=t-12}else{if(t==0){m=12}else{m=t}}for(var n=0;n=t){break}}var G=e[A][0];var D=e[A][1];if(D=="year"){if(o.minTickSize!=null&&o.minTickSize[1]=="year"){G=Math.floor(o.minTickSize[0])}else{var r=Math.pow(10,Math.floor(Math.log(w.delta/b.year)/Math.LN10));var q=(w.delta/b.year)/r;if(q<1.5){G=1}else{if(q<3){G=2}else{if(q<7.5){G=5}else{G=10}}}G*=r}if(G<1){G=1}}w.tickSize=o.tickSize||[G,D];var z=w.tickSize[0];D=w.tickSize[1];var u=z*b[D];if(D=="second"){B.setSeconds(d(B.getSeconds(),z))}if(D=="minute"){B.setMinutes(d(B.getMinutes(),z))}if(D=="hour"){B.setHours(d(B.getHours(),z))}if(D=="month"){B.setMonth(d(B.getMonth(),z))}if(D=="year"){B.setFullYear(d(B.getFullYear(),z))}B.setMilliseconds(0);if(u>=b.minute){B.setSeconds(0)}if(u>=b.hour){B.setMinutes(0)}if(u>=b.day){B.setHours(0)}if(u>=b.day*4){B.setDate(1)}if(u>=b.year){B.setMonth(0)}var F=0,E=Number.NaN,x;do{x=E;E=B.getTime();C.push(E);if(D=="month"){if(z<1){B.setDate(1);var s=B.getTime();B.setMonth(B.getMonth()+1);var y=B.getTime();B.setTime(E+F*b.hour+(y-s)*z);F=B.getHours();B.setHours(0)}else{B.setMonth(B.getMonth()+z)}}else{if(D=="year"){B.setFullYear(B.getFullYear()+z)}else{B.setTime(E+u)}}}while(E