1 line · 1.1 KB · JavaScript
RawDownload
(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;t<e.length;t+=l){p=e[t];a=e[t+1];f=n;if(a<d)n=g;else n=v;if(D&&f!=n&&p!=null&&t>0&&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;s<l;++s)f.push(e[t+s]);n.push(null);n.push(null);for(s=2;s<l;++s)n.push(e[t+s]);n.push(c);n.push(d);for(s=2;s<l;++s)n.push(e[t+s])};n.push(p);n.push(a);for(s=2;s<l;++s)n.push(e[t+s])};u.points=v;r.datapoints.points=g;if(r.datapoints.points.length>0){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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t