(function(o){var s={series:{threshold:null}};function t(s){function t(h,i,u,d,b){var l=u.pointsize,t,p,a,n,f,r=o.extend({},i);r.datapoints={points:[],pointsize:l,format:u.format};r.label=null;r.color=b;r.threshold=null;r.originSeries=i;r.data=[];var e=u.points,D=i.lines.show,g=[],v=[],s;for(t=0;t0&&e[t-l]!=null){var c=p+(d-a)*(p-e[t-l])/(a-e[t-l+1]);f.push(c);f.push(d);for(s=2;s0){var w=o.inArray(i,h.getData());h.getData().splice(w+1,0,r)}};function n(n,s,e){if(!s.threshold)return;if(s.threshold instanceof Array){s.threshold.sort(function(o,s){return o.below-s.below});o(s.threshold).each(function(o,l){t(n,s,e,l.below,l.color)})}else{t(n,s,e,s.threshold.below,s.threshold.color)}};s.hooks.processDatapoints.push(n)};o.plot.plugins.push({init:t,options:s,name:'threshold',version:'1.2'})})(jQuery);