Changeset 13716
- Timestamp:
- 05/13/08 00:55:30 (3 months ago)
- Location:
- dojox/trunk/charting
- Files:
-
- 1 added
- 14 modified
-
axis2d/Default.js (modified) (2 diffs)
-
Chart2D.js (modified) (1 diff)
-
plot2d/Bars.js (modified) (1 diff)
-
plot2d/Base.js (modified) (1 diff)
-
plot2d/Bubble.js (modified) (1 diff)
-
plot2d/ClusteredBars.js (modified) (1 diff)
-
plot2d/ClusteredColumns.js (modified) (1 diff)
-
plot2d/Columns.js (modified) (1 diff)
-
plot2d/Default.js (modified) (1 diff)
-
plot2d/Grid.js (modified) (3 diffs)
-
plot2d/Stacked.js (modified) (1 diff)
-
plot2d/StackedBars.js (modified) (1 diff)
-
plot2d/StackedColumns.js (modified) (1 diff)
-
scaler/primitive.js (modified) (1 diff)
-
tests/test_win2d.html (added)
Legend:
- Unmodified
- Added
- Removed
-
dojox/trunk/charting/axis2d/Default.js
r13715 r13716 71 71 }, 72 72 setWindow: function(scale, offset){ 73 this.scale = scale; 74 this.offset = offset; 73 if(scale == 1 && offset == 0){ 74 delete this.scale; 75 delete this.offset; 76 }else{ 77 this.scale = scale; 78 this.offset = offset; 79 } 75 80 return this.clear(); 81 }, 82 getWindowScale: function(){ 83 return "scale" in this ? this.scale : 1; 84 }, 85 getWindowOffset: function(){ 86 return "offset" in this ? this.offset : 0; 76 87 }, 77 88 calculate: function(min, max, span, labels){ … … 82 93 // calculate new range 83 94 this.opt.from = this.scaler.bounds.lower + this.offset; 84 this.opt.to = (this.scaler.bounds.upper - this.scaler.bounds.lower) / scale + this.opt.from;95 this.opt.to = (this.scaler.bounds.upper - this.scaler.bounds.lower) / this.scale + this.opt.from; 85 96 // make sure that bounds are correct 86 if( isInfinite(this.opt.from) || isNaN(this.opt.from) || isInfinite(this.opt.to) || isNaN(this.opt.to) ||87 this.opt.to - this. from.to>= this.scaler.bounds.upper - this.scaler.bounds.lower){97 if(!isFinite(this.opt.from) || isNaN(this.opt.from) || !isFinite(this.opt.to) || isNaN(this.opt.to) || 98 this.opt.to - this.opt.from >= this.scaler.bounds.upper - this.scaler.bounds.lower){ 88 99 // any error --- remove from/to bounds 89 100 delete this.opt.from; -
dojox/trunk/charting/Chart2D.js
r13715 r13716 216 216 } 217 217 df.forIn(this.axes, function(axis){ 218 var scale, offset, bounds = axis. scaler.bounds,218 var scale, offset, bounds = axis.getScaler().bounds, 219 219 s = bounds.span / (bounds.upper - bounds.lower); 220 220 if(axis.vertical){ 221 221 scale = sy; 222 offset = ("offset" in axis ? axis.offset : 0) +dy / s / scale;222 offset = dy / s / scale; 223 223 }else{ 224 224 scale = sx; 225 offset = ("offset" in axis ? axis.offset : 0) +dx / s / scale;225 offset = dx / s / scale; 226 226 } 227 227 axis.setWindow(scale, offset); -
dojox/trunk/charting/plot2d/Bars.js
r13715 r13716 40 40 }, 41 41 render: function(dim, offsets){ 42 this.dirty = this.isDirty(); 42 43 if(this.dirty){ 43 44 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/Base.js
r13715 r13716 25 25 calculateAxes: function(dim){ 26 26 return this; 27 }, 28 isDirty: function(){ 29 return this.dirty || this._hAxis && this._hAxis.dirty || this._vAxis && this._vAxis.dirty; 27 30 }, 28 31 render: function(dim, offsets){ -
dojox/trunk/charting/plot2d/Bubble.js
r13715 r13716 17 17 // override the render so that we are plotting only circles. 18 18 render: function(dim, offsets){ 19 this.dirty = this.isDirty(); 19 20 if(this.dirty){ 20 21 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/ClusteredBars.js
r13715 r13716 13 13 dojo.declare("dojox.charting.plot2d.ClusteredBars", dojox.charting.plot2d.Bars, { 14 14 render: function(dim, offsets){ 15 this.dirty = this.isDirty(); 15 16 if(this.dirty){ 16 17 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/ClusteredColumns.js
r13715 r13716 13 13 dojo.declare("dojox.charting.plot2d.ClusteredColumns", dojox.charting.plot2d.Columns, { 14 14 render: function(dim, offsets){ 15 this.dirty = this.isDirty(); 15 16 if(this.dirty){ 16 17 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/Columns.js
r13715 r13716 38 38 }, 39 39 render: function(dim, offsets){ 40 this.dirty = this.isDirty(); 40 41 if(this.dirty){ 41 42 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/Default.js
r13715 r13716 48 48 }, 49 49 render: function(dim, offsets){ 50 this.dirty = this.isDirty(); 50 51 if(this.dirty){ 51 52 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/Grid.js
r13715 r13716 26 26 this.hAxis = this.opt.hAxis; 27 27 this.vAxis = this.opt.vAxis; 28 this.dirty = true; 28 29 }, 29 30 clear: function(){ … … 47 48 return this; 48 49 }, 50 isDirty: function(){ 51 return this.dirty || this._hAxis && this._hAxis.dirty || this._vAxis && this._vAxis.dirty; 52 }, 49 53 getRequiredColors: function(){ 50 54 return 0; … … 52 56 render: function(dim, offsets){ 53 57 // draw horizontal stripes and lines 58 this.dirty = this.isDirty(); 54 59 if(!this.dirty){ return this; } 55 60 this.cleanGroup(); -
dojox/trunk/charting/plot2d/Stacked.js
r13715 r13716 41 41 } 42 42 // draw runs in backwards 43 this.dirty = this.isDirty(); 43 44 if(this.dirty){ 44 45 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/StackedBars.js
r13715 r13716 34 34 } 35 35 // draw runs in backwards 36 this.dirty = this.isDirty(); 36 37 if(this.dirty){ 37 38 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/plot2d/StackedColumns.js
r13715 r13716 32 32 } 33 33 // draw runs in backwards 34 this.dirty = this.isDirty(); 34 35 if(this.dirty){ 35 36 dojo.forEach(this.series, purgeGroup); -
dojox/trunk/charting/scaler/primitive.js
r13715 r13716 9 9 from: min, 10 10 to: max, 11 scale: span / (max - min) 11 scale: span / (max - min), 12 span: span 12 13 }, 13 14 scaler: dojox.charting.scaler.primitive