You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
!function(s){function n(s){function n(s,n){for(var t=null,i=0;i<n.length&&s!=n[i];++i)n[i].stack==s.stack&&(t=n[i]);return t}function t(s,t,i){if(null!=t.stack&&t.stack!==!1){var l=n(t,s.getData());if(l){for(var o,e,f,u,a,r,p,h,c=i.pointsize,g=i.points,k=l.datapoints.pointsize,v=l.datapoints.points,m=[],z=t.lines.show,b=t.bars.horizontal,d=c>2&&(b?i.format[2].x:i.format[2].y),y=z&&t.lines.steps,D=!0,j=b?1:0,w=b?0:1,x=0,Q=0;;){if(x>=g.length)break;if(p=m.length,null==g[x]){for(h=0;c>h;++h)m.push(g[x+h]);x+=c}else if(Q>=v.length){if(!z)for(h=0;c>h;++h)m.push(g[x+h]);x+=c}else if(null==v[Q]){for(h=0;c>h;++h)m.push(null);D=!0,Q+=k}else{if(o=g[x+j],e=g[x+w],u=v[Q+j],a=v[Q+w],r=0,o==u){for(h=0;c>h;++h)m.push(g[x+h]);m[p+w]+=a,r=a,x+=c,Q+=k}else if(o>u){if(z&&x>0&&null!=g[x-c]){for(f=e+(g[x-c+w]-e)*(u-o)/(g[x-c+j]-o),m.push(u),m.push(f+a),h=2;c>h;++h)m.push(g[x+h]);r=a}Q+=k}else{if(D&&z){x+=c;continue}for(h=0;c>h;++h)m.push(g[x+h]);z&&Q>0&&null!=v[Q-k]&&(r=a+(v[Q-k+w]-a)*(o-u)/(v[Q-k+j]-u)),m[p+w]+=r,x+=c}D=!1,p!=m.length&&d&&(m[p+2]+=r)}if(y&&p!=m.length&&p>0&&null!=m[p]&&m[p]!=m[p-c]&&m[p+1]!=m[p-c+1]){for(h=0;c>h;++h)m[p+c+h]=m[p+h];m[p+1]=m[p-c+1]}}i.points=m}}}s.hooks.processDatapoints.push(t)}var t={series:{stack:null}};s.plot.plugins.push({init:n,options:t,name:"stack",version:"1.2"})}(jQuery); |