You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
2.4 KiB
8 lines
2.4 KiB
/*
|
|
YUI 3.17.2 (build 9c3c78e)
|
|
Copyright 2014 Yahoo! Inc. All rights reserved.
|
|
Licensed under the BSD License.
|
|
http://yuilibrary.com/license/
|
|
*/
|
|
|
|
YUI.add("series-stacked",function(e,t){function r(){}var n=e.Lang;r.prototype={_stacked:!0,_stackCoordinates:function(){this.get("direction")==="vertical"?this._stackXCoords():this._stackYCoords()},_stackXCoords:function(){var e=this.get("order"),t=this.get("seriesTypeCollection"),r=0,i=this.get("xcoords"),s=this.get("ycoords"),o,u,a,f,l=i.concat(),c,h,p=[],d;e>0?(c=t[e-1].get("stackedXCoords"),h=t[e-1].get("stackedYCoords"),o=c.length):o=i.length;for(;r<o;r+=1)if(n.isNumber(i[r])){if(e>0){a=c[r];if(!n.isNumber(a)){f=e;while(f>-1&&!n.isNumber(a))f-=1,f>-1?a=t[f].get("stackedXCoords")[r]:a=this._leftOrigin}i[r]=i[r]+a}l[r]=i[r]}else p.push(r);this._cleanXNaN(l,s),o=p.length;if(o>0)for(r=0;r<o;r+=1)d=p[r],u=e>0?c[d]:this._leftOrigin,l[d]=Math.max(l[d],u);this.set("stackedXCoords",l),this.set("stackedYCoords",s)},_stackYCoords:function(){var e=this.get("order"),t=this.get("graphic"),r=t.get("height"),i=this.get("seriesTypeCollection"),s=0,o=this.get("xcoords"),u=this.get("ycoords"),a,f,l,c,h=u.concat(),p,d,v=[],m;e>0?(p=i[e-1].get("stackedXCoords"),d=i[e-1].get("stackedYCoords"),a=d.length):a=u.length;for(;s<a;s+=1)if(n.isNumber(u[s])){if(e>0){l=d[s];if(!n.isNumber(l)){c=e;while(c>-1&&!n.isNumber(l))c-=1,c>-1?l=i[c].get("stackedYCoords")[s]:l=this._bottomOrigin}u[s]=l-(r-u[s])}h[s]=u[s]}else v.push(s);this._cleanYNaN(o,h),a=v.length;if(a>0)for(s=0;s<a;s+=1)m=v[s],f=e>0?d[m]:r,h[m]=Math.min(h[m],f);this.set("stackedXCoords",o),this.set("stackedYCoords",h)},_cleanXNaN:function(e,t){var r,i,s,o,u,a,f,l,c=n.isNumber,h,p=0,d=t.length;for(;p<d;++p)u=e[p],a=t[p],!c(u)&&p>0&&p<d-1&&(o=t[p-1],s=this._getPreviousValidCoordValue(e,p),l=t[p+1],f=this._getNextValidCoordValue(e,p),c(s)&&c(f)&&(h=(l-o)/(f-s),e[p]=(a+h*s-o)/h),r=NaN,i=NaN)},_getPreviousValidCoordValue:function(e,t){var r,i=n.isNumber,s=-1;while(!i(r)&&t>s)t-=1,r=e[t];return r},_getNextValidCoordValue:function(e,t){var r,i=n.isNumber,s=e.length;while(!i(r)&&t<s)t+=1,r=e[t];return r},_cleanYNaN:function(e,t){var r,i,s,o,u,a,f,l,c=n.isNumber,h,p=0,d=e.length;for(;p<d;++p)u=e[p],a=t[p],!c(a)&&p>0&&p<d-1&&(s=e[p-1],o=this._getPreviousValidCoordValue(t,p),f=e[p+1],l=this._getNextValidCoordValue(t,p),c(o)&&c(l)&&(h=(l-o)/(f-s),t[p]=o+(h*u-h*s)),r=NaN,i=NaN)}},e.StackingUtil=r},"3.17.2",{requires:["axis-stacked"]});
|
|
|