text: (function(f){var e=Math.floor,b=Math.abs;function a(B,n){var v=B.length;if(n>=v||n===0){return B}var y=[],u=0;var C=(v-2)/(n-2);var A=0,q,r,x,h;y[u++]=B[A];for(var w=0;w<n-2;w++){var m=0,k=0,o=e((w+1)*C)+1,t=e((w+2)*C)+1;t=t<v?t:v;var s=t-o;for(;o<t;o++){m+=B[o][0]*1;k+=B[o][1]*1}m/=s;k/=s;var p=e((w+0)*C)+1,z=e((w+1)*C)+1;var l=B[A][0]*1,j=B[A][1]*1;r=x=-1;for(;p<z;p++){x=b((l-m)*(B[p][1]-j)-(l-B[p][0])*(k-j))*0.5;if(x>r){r=x;q=B[p];h=p}}y[u++]=q;A=h}y[u++]=B[v-1];return y}function d(i,h){h.data=a(h.data,h.downsample.threshold)}var c={series:{downsample:{threshold:1000}}};function g(h){h.hooks.processRawData.push(d)}f.plot.plugins.push({init:g,options:c,name:"downsample",version:"0.1"})})(jQuery);