Base.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
  3. Available via Academic Free License >= 2.1 OR the modified BSD license.
  4. see: http://dojotoolkit.org/license for details
  5. */
  6. if(!dojo._hasResource["dojox.charting.axis2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
  7. dojo._hasResource["dojox.charting.axis2d.Base"] = true;
  8. dojo.provide("dojox.charting.axis2d.Base");
  9. dojo.require("dojox.charting.Element");
  10. dojo.declare("dojox.charting.axis2d.Base", dojox.charting.Element, {
  11. // summary:
  12. // The base class for any axis. This is more of an interface/API
  13. // definition than anything else; see dojox.charting.axis2d.Default
  14. // for more details.
  15. constructor: function(chart, kwArgs){
  16. // summary:
  17. // Return a new base axis.
  18. // chart: dojox.charting.Chart2D
  19. // The chart this axis belongs to.
  20. // kwArgs: dojox.charting.axis2d.__AxisCtorArgs?
  21. // An optional arguments object to define the axis parameters.
  22. this.vertical = kwArgs && kwArgs.vertical;
  23. },
  24. clear: function(){
  25. // summary:
  26. // Stub function for clearing the axis.
  27. // returns: dojox.charting.axis2d.Base
  28. // A reference to the axis for functional chaining.
  29. return this; // dojox.charting.axis2d.Base
  30. },
  31. initialized: function(){
  32. // summary:
  33. // Return a flag as to whether or not this axis has been initialized.
  34. // returns: Boolean
  35. // If the axis is initialized or not.
  36. return false; // Boolean
  37. },
  38. calculate: function(min, max, span){
  39. // summary:
  40. // Stub function to run the calcuations needed for drawing this axis.
  41. // returns: dojox.charting.axis2d.Base
  42. // A reference to the axis for functional chaining.
  43. return this; // dojox.charting.axis2d.Base
  44. },
  45. getScaler: function(){
  46. // summary:
  47. // A stub function to return the scaler object created during calculate.
  48. // returns: Object
  49. // The scaler object (see dojox.charting.scaler.linear for more information)
  50. return null; // Object
  51. },
  52. getTicks: function(){
  53. // summary:
  54. // A stub function to return the object that helps define how ticks are rendered.
  55. // returns: Object
  56. // The ticks object.
  57. return null; // Object
  58. },
  59. getOffsets: function(){
  60. // summary:
  61. // A stub function to return any offsets needed for axis and series rendering.
  62. // returns: Object
  63. // An object of the form { l, r, t, b }.
  64. return {l: 0, r: 0, t: 0, b: 0}; // Object
  65. },
  66. render: function(dim, offsets){
  67. // summary:
  68. // Stub function to render this axis.
  69. // returns: dojox.charting.axis2d.Base
  70. // A reference to the axis for functional chaining.
  71. this.dirty = false;
  72. return this; // dojox.charting.axis2d.Base
  73. }
  74. });
  75. }