!function(s){s.plot.plugins.push({init:function(o){o.hooks.processDatapoints.push(function(o,n,t){if(n.threshold){var p,i,h,e,l,u=t.pointsize,r=s.extend({},n);r.datapoints={points:[],pointsize:u},r.label=null,r.color=n.threshold.color,r.threshold=null,r.originSeries=n,r.data=[];var a=n.threshold.below,d=t.points,f=n.lines.show;for(threspoints=[],newpoints=[],p=0;p<d.length;p+=u){if(i=d[p],h=d[p+1],l=e,e=h<a?threspoints:newpoints,f&&l!=e&&null!=i&&p>0&&null!=d[p-u]){var c=(i-d[p-u])/(h-d[p-u+1])*(a-h)+i;for(l.push(c),l.push(a),m=2;m<u;++m)l.push(d[p+m]);for(e.push(null),e.push(null),m=2;m<u;++m)e.push(d[p+m]);for(e.push(c),e.push(a),m=2;m<u;++m)e.push(d[p+m])}e.push(i),e.push(h)}t.points=newpoints,r.datapoints.points=threspoints,r.datapoints.points.length>0&&o.getData().push(r)}})},options:{series:{threshold:null}},name:"threshold",version:"1.0"})}(jQuery);