ChartAction.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. define("dojox/charting/action2d/ChartAction", ["dojo/_base/connect", "dojo/_base/declare", "./Base"],
  2. function(hub, declare, Base){
  3. /*=====
  4. var Base = dojox.charting.action2d.Base;
  5. =====*/
  6. return declare("dojox.charting.action2d.ChartAction", Base, {
  7. // summary:
  8. // Base action class for chart actions.
  9. constructor: function(chart, plot){
  10. // summary:
  11. // Create a new base chart action.
  12. // chart: dojox.charting.Chart
  13. // The chart this action applies to.
  14. // plot: String?|dojox.charting.plot2d.Base?
  15. // Optional target plot for this chart action. Default is "default".
  16. },
  17. connect: function(){
  18. // summary:
  19. // Connect this action to the chart.
  20. for(var i = 0; i < this._listeners.length; ++i){
  21. this._listeners[i].handle = hub.connect(this.chart.node, this._listeners[i].eventName,
  22. this, this._listeners[i].methodName);
  23. }
  24. },
  25. disconnect: function(){
  26. // summary:
  27. // Disconnect this action from the chart.
  28. for(var i = 0; i < this._listeners.length; ++i){
  29. hub.disconnect(this._listeners[i].handle);
  30. delete this._listeners[i].handle;
  31. }
  32. }
  33. });
  34. });