⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stackedbars.js

📁 用最近的dojo1.2.1制作前端的ajax购书网站
💻 JS
字号:
/*	Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved.	Available via Academic Free License >= 2.1 OR the modified BSD license.	see: http://dojotoolkit.org/license for details*/if(!dojo._hasResource["dojox.charting.plot2d.StackedBars"]){dojo._hasResource["dojox.charting.plot2d.StackedBars"]=true;dojo.provide("dojox.charting.plot2d.StackedBars");dojo.require("dojox.charting.plot2d.common");dojo.require("dojox.charting.plot2d.Bars");dojo.require("dojox.lang.functional");dojo.require("dojox.lang.functional.reversed");(function(){var df=dojox.lang.functional,dc=dojox.charting.plot2d.common,_3=df.lambda("item.purgeGroup()");dojo.declare("dojox.charting.plot2d.StackedBars",dojox.charting.plot2d.Bars,{calculateAxes:function(_4){var _5=dc.collectStackedStats(this.series),t;this._maxRunLength=_5.hmax;_5.hmin-=0.5;_5.hmax+=0.5;t=_5.hmin,_5.hmin=_5.vmin,_5.vmin=t;t=_5.hmax,_5.hmax=_5.vmax,_5.vmax=t;this._calc(_4,_5);return this;},render:function(_7,_8){if(this._maxRunLength<=0){return this;}var _9=df.repeat(this._maxRunLength,"-> 0",0);for(var i=0;i<this.series.length;++i){var _b=this.series[i];for(var j=0;j<_b.data.length;++j){var v=_b.data[j];if(isNaN(v)){v=0;}_9[j]+=v;}}this.dirty=this.isDirty();if(this.dirty){dojo.forEach(this.series,_3);this.cleanGroup();var s=this.group;df.forEachRev(this.series,function(_f){_f.cleanGroup(s);});}var t=this.chart.theme,_11,_12,_13,f,gap,_16,ht=this._hScaler.scaler.getTransformerFromModel(this._hScaler),vt=this._vScaler.scaler.getTransformerFromModel(this._vScaler);events=this.events();f=dc.calculateBarSize(this._vScaler.bounds.scale,this.opt);gap=f.gap;_16=f.size;this.resetEvents();for(var i=this.series.length-1;i>=0;--i){var _b=this.series[i];if(!this.dirty&&!_b.dirty){continue;}_b.cleanGroup();var s=_b.group;if(!_b.fill||!_b.stroke){_11=_b.dyn.color=new dojo.Color(t.next("color"));}_12=_b.stroke?_b.stroke:dc.augmentStroke(t.series.stroke,_11);_13=_b.fill?_b.fill:dc.augmentFill(t.series.fill,_11);for(var j=0;j<_9.length;++j){var v=_9[j],_19=ht(v);if(_19>=1&&_16>=1){var _1a=s.createRect({x:_8.l,y:_7.height-_8.b-vt(j+1.5)+gap,width:_19,height:_16}).setFill(_13).setStroke(_12);_b.dyn.fill=_1a.getFill();_b.dyn.stroke=_1a.getStroke();if(events){var o={element:"bar",index:j,run:_b,plot:this,hAxis:this.hAxis||null,vAxis:this.vAxis||null,shape:_1a,x:v,y:j+1.5};this._connectEvents(_1a,o);}}}_b.dirty=false;for(var j=0;j<_b.data.length;++j){var v=_b.data[j];if(isNaN(v)){v=0;}_9[j]-=v;}}this.dirty=false;return this;}});})();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -