NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / series-histogram-base / series-histogram-base-min.js
blobfb9ab80de1db8db534f57ab114438b13ab8eebc2
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add("series-histogram-base",function(e,t){function r(){}var n=e.Lang;r.prototype={drawSeries:function(){if(this.get("xcoords").length<1)return;var t=e.clone(this.get("styles").marker),r=this.get("graphic"),i,s,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("seriesTypeCollection"),h=c.length||0,p=0,d=0,v=0,m,g,y=this.get("order"),b=this.get("graphOrder"),w,E,S,x,T,N=null,C=null,k=[],L=[],A,O,M,_,D={width:[],height:[]},P=[],H=[],B=this.get("groupMarkers");n.isArray(t.fill.color)&&(N=t.fill.color.concat()),n.isArray(t.border.color)&&(C=t.border.color.concat()),this.get("direction")==="vertical"?(S="height",x="width"):(S="width",x="height"),i=t[S],s=t[x],this._createMarkerCache();for(;a<h;++a)g=c[a],p+=g.get("styles").marker[S],y>a&&(v=p);d=f*p,this._maxSize=r.get(S),d>this._maxSize&&(m=r.get(S)/d,p*=m,v*=m,i*=m,i=Math.max(i,1),this._maxSize=i),v-=p/2;for(a=0;a<f;++a){A=o[a]-p/2,O=A+p,M=u[a]-p/2,_=M+p,k.push({start:A,end:O}),L.push({start:M,end:_});if(isNaN(o[a])||isNaN(u[a])){this._markers.push(null);continue}T=this._getMarkerDimensions(o[a],u[a],s,v),!isNaN(T.calculatedSize)&&T.calculatedSize>0?(l=T.top,w=T.left,B?(D[S][a]=i,D[x][a]=T.calculatedSize,P.push(w),H.push(l)):(t[S]=i,t[x]=T.calculatedSize,t.x=w,t.y=l,N&&(t.fill.color=N[a%N.length]),C&&(t.border.color=C[a%C.length]),E=this.getMarker(t,b,a))):B||this._markers.push(null)}this.set("xMarkerPlane",k),this.set("yMarkerPlane",L),B?this._createGroupMarker({fill:t.fill,border:t.border,dimensions:D,xvalues:P,yvalues:H,shape:t.shape}):this._clearMarkerCache()},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:12,height:12,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},e.Histogram=r},"3.13.0",{requires:["series-cartesian","series-plot-util"]});