[483] | 1 | define(["dojo/_base/declare", "../Element"], |
---|
| 2 | function(declare, Element){ |
---|
| 3 | /*===== |
---|
| 4 | var __BaseAxisCtorArgs = { |
---|
| 5 | // summary: |
---|
| 6 | // Optional arguments used in the definition of an invisible axis. |
---|
| 7 | // vertical: Boolean? |
---|
| 8 | // A flag that says whether an axis is vertical (i.e. y axis) or horizontal. Default is false (horizontal). |
---|
| 9 | // min: Number? |
---|
| 10 | // The smallest value on an axis. Default is 0. |
---|
| 11 | // max: Number? |
---|
| 12 | // The largest value on an axis. Default is 1. |
---|
| 13 | }; |
---|
| 14 | =====*/ |
---|
| 15 | return declare("dojox.charting.axis2d.Base", Element, { |
---|
| 16 | // summary: |
---|
| 17 | // The base class for any axis. This is more of an interface/API |
---|
| 18 | // definition than anything else; see dojox.charting.axis2d.Default |
---|
| 19 | // for more details. |
---|
| 20 | constructor: function(chart, kwArgs){ |
---|
| 21 | // summary: |
---|
| 22 | // Return a new base axis. |
---|
| 23 | // chart: dojox/charting/Chart |
---|
| 24 | // The chart this axis belongs to. |
---|
| 25 | // kwArgs: __BaseAxisCtorArgs? |
---|
| 26 | // An optional arguments object to define the axis parameters. |
---|
| 27 | this.vertical = kwArgs && kwArgs.vertical; |
---|
| 28 | this.opt = {}; |
---|
| 29 | this.opt.min = kwArgs && kwArgs.min; |
---|
| 30 | this.opt.max = kwArgs && kwArgs.max; |
---|
| 31 | }, |
---|
| 32 | clear: function(){ |
---|
| 33 | // summary: |
---|
| 34 | // Stub function for clearing the axis. |
---|
| 35 | // returns: dojox/charting/axis2d/Base |
---|
| 36 | // A reference to the axis for functional chaining. |
---|
| 37 | return this; // dojox/charting/axis2d/Base |
---|
| 38 | }, |
---|
| 39 | initialized: function(){ |
---|
| 40 | // summary: |
---|
| 41 | // Return a flag as to whether or not this axis has been initialized. |
---|
| 42 | // returns: Boolean |
---|
| 43 | // If the axis is initialized or not. |
---|
| 44 | return false; // Boolean |
---|
| 45 | }, |
---|
| 46 | calculate: function(min, max, span){ |
---|
| 47 | // summary: |
---|
| 48 | // Stub function to run the calcuations needed for drawing this axis. |
---|
| 49 | // returns: dojox/charting/axis2d/Base |
---|
| 50 | // A reference to the axis for functional chaining. |
---|
| 51 | return this; // dojox/charting/axis2d/Base |
---|
| 52 | }, |
---|
| 53 | getScaler: function(){ |
---|
| 54 | // summary: |
---|
| 55 | // A stub function to return the scaler object created during calculate. |
---|
| 56 | // returns: Object |
---|
| 57 | // The scaler object (see dojox.charting.scaler.linear for more information) |
---|
| 58 | return null; // Object |
---|
| 59 | }, |
---|
| 60 | getTicks: function(){ |
---|
| 61 | // summary: |
---|
| 62 | // A stub function to return the object that helps define how ticks are rendered. |
---|
| 63 | // returns: Object |
---|
| 64 | // The ticks object. |
---|
| 65 | return null; // Object |
---|
| 66 | }, |
---|
| 67 | getOffsets: function(){ |
---|
| 68 | // summary: |
---|
| 69 | // A stub function to return any offsets needed for axis and series rendering. |
---|
| 70 | // returns: Object |
---|
| 71 | // An object of the form { l, r, t, b }. |
---|
| 72 | return {l: 0, r: 0, t: 0, b: 0}; // Object |
---|
| 73 | }, |
---|
| 74 | render: function(dim, offsets){ |
---|
| 75 | // summary: |
---|
| 76 | // Stub function to render this axis. |
---|
| 77 | // returns: dojox/charting/axis2d/Base |
---|
| 78 | // A reference to the axis for functional chaining. |
---|
| 79 | this.dirty = false; |
---|
| 80 | return this; // dojox/charting/axis2d/Base |
---|
| 81 | } |
---|
| 82 | }); |
---|
| 83 | }); |
---|