]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojox/charting/plot2d/Base.js
Comment class stub
[eow] / static / dojo-release-1.1.1 / dojox / charting / plot2d / Base.js
1 if(!dojo._hasResource["dojox.charting.plot2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.charting.plot2d.Base"] = true;
3 dojo.provide("dojox.charting.plot2d.Base");
4
5 dojo.require("dojox.charting.Element");
6 dojo.require("dojox.charting.plot2d.common");
7
8 dojo.declare("dojox.charting.plot2d.Base", dojox.charting.Element, {
9         clear: function(){
10                 this.series = [];
11                 this._hAxis = null;
12                 this._vAxis = null;
13                 this.dirty = true;
14                 return this;
15         },
16         setAxis: function(axis){
17                 if(axis){
18                         this[axis.vertical ? "_vAxis" : "_hAxis"] = axis;
19                 }
20                 return this;
21         },
22         addSeries: function(run){
23                 this.series.push(run);
24                 return this;
25         },
26         calculateAxes: function(dim){
27                 return this;
28         },
29         render: function(dim, offsets){
30                 return this;
31         },
32         getRequiredColors: function(){
33                 return this.series.length;
34         },
35         
36         // utilities
37         _calc: function(dim, stats){
38                 // calculate scaler
39                 if(this._hAxis){
40                         if(!this._hAxis.initialized()){
41                                 this._hAxis.calculate(stats.hmin, stats.hmax, dim.width);
42                         }
43                         this._hScaler = this._hAxis.getScaler();
44                 }else{
45                         this._hScaler = {bounds: {lower: stats.hmin, upper: stats.hmax}, 
46                                 scale: dim.width / (stats.hmax - stats.hmin)};
47                 }
48                 if(this._vAxis){
49                         if(!this._vAxis.initialized()){
50                                 this._vAxis.calculate(stats.vmin, stats.vmax, dim.height);
51                         }
52                         this._vScaler = this._vAxis.getScaler();
53                 }else{
54                         this._vScaler = {bounds: {lower: stats.vmin, upper: stats.vmax}, 
55                                 scale: dim.height / (stats.vmax - stats.vmin)};
56                 }
57         }
58 });
59
60 }