summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/charting/action2d
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Base.js91
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Base.xd.js98
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Highlight.js139
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Highlight.xd.js145
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Magnify.js128
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Magnify.xd.js135
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/MoveSlice.js139
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/MoveSlice.xd.js148
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Shake.js122
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Shake.xd.js129
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Tooltip.js170
-rw-r--r--js/dojo-1.6/dojox/charting/action2d/Tooltip.xd.js180
12 files changed, 1624 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/charting/action2d/Base.js b/js/dojo-1.6/dojox/charting/action2d/Base.js
new file mode 100644
index 0000000..b4deda2
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Base.js
@@ -0,0 +1,91 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Base"] = true;
+dojo.provide("dojox.charting.action2d.Base");
+
+dojo.require("dojo.fx.easing");
+dojo.require("dojox.lang.functional.object");
+dojo.require("dojox.gfx.fx");
+
+/*=====
+dojox.charting.action2d.__BaseCtorArgs = function(duration, easing){
+ // summary:
+ // The base keyword arguments object for creating an action2d.
+ // duration: Number?
+ // The amount of time in milliseconds for an animation to last. Default is 400.
+ // easing: dojo.fx.easing.*?
+ // An easing object (see dojo.fx.easing) for use in an animation. The
+ // default is dojo.fx.easing.backOut.
+ this.duration = duration;
+ this.easing = easing;
+}
+=====*/
+(function(){
+ var DEFAULT_DURATION = 400, // ms
+ DEFAULT_EASING = dojo.fx.easing.backOut,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.Base", null, {
+
+ overOutEvents: {onmouseover: 1, onmouseout: 1},
+
+ constructor: function(chart, plot, kwargs){
+ // summary:
+ // Create a new base Action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action applies to.
+ // plot: String?
+ // The name of the plot this action belongs to. If none is passed "default" is assumed.
+ // kwargs: dojox.charting.action2d.__BaseCtorArgs?
+ // Optional arguments for the action.
+ this.chart = chart;
+ this.plot = plot || "default";
+ this.anim = {};
+
+ // process common optional named parameters
+ if(!kwargs){ kwargs = {}; }
+ this.duration = kwargs.duration ? kwargs.duration : DEFAULT_DURATION;
+ this.easing = kwargs.easing ? kwargs.easing : DEFAULT_EASING;
+ },
+
+ connect: function(){
+ // summary:
+ // Connect this action to the given plot.
+ this.handle = this.chart.connectToPlot(this.plot, this, "process");
+ },
+
+ disconnect: function(){
+ // summary:
+ // Disconnect this action from the given plot, if connected.
+ if(this.handle){
+ dojo.disconnect(this.handle);
+ this.handle = null;
+ }
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the action.
+ },
+
+ destroy: function(){
+ // summary:
+ // Do any cleanup needed when destroying parent elements.
+ this.disconnect();
+ df.forIn(this.anim, function(o){
+ df.forIn(o, function(anim){
+ anim.action.stop(true);
+ });
+ });
+ this.anim = {};
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/Base.xd.js b/js/dojo-1.6/dojox/charting/action2d/Base.xd.js
new file mode 100644
index 0000000..666bcc2
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Base.xd.js
@@ -0,0 +1,98 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.Base"],
+["require", "dojo.fx.easing"],
+["require", "dojox.lang.functional.object"],
+["require", "dojox.gfx.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.Base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Base"] = true;
+dojo.provide("dojox.charting.action2d.Base");
+
+dojo.require("dojo.fx.easing");
+dojo.require("dojox.lang.functional.object");
+dojo.require("dojox.gfx.fx");
+
+/*=====
+dojox.charting.action2d.__BaseCtorArgs = function(duration, easing){
+ // summary:
+ // The base keyword arguments object for creating an action2d.
+ // duration: Number?
+ // The amount of time in milliseconds for an animation to last. Default is 400.
+ // easing: dojo.fx.easing.*?
+ // An easing object (see dojo.fx.easing) for use in an animation. The
+ // default is dojo.fx.easing.backOut.
+ this.duration = duration;
+ this.easing = easing;
+}
+=====*/
+(function(){
+ var DEFAULT_DURATION = 400, // ms
+ DEFAULT_EASING = dojo.fx.easing.backOut,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.Base", null, {
+
+ overOutEvents: {onmouseover: 1, onmouseout: 1},
+
+ constructor: function(chart, plot, kwargs){
+ // summary:
+ // Create a new base Action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action applies to.
+ // plot: String?
+ // The name of the plot this action belongs to. If none is passed "default" is assumed.
+ // kwargs: dojox.charting.action2d.__BaseCtorArgs?
+ // Optional arguments for the action.
+ this.chart = chart;
+ this.plot = plot || "default";
+ this.anim = {};
+
+ // process common optional named parameters
+ if(!kwargs){ kwargs = {}; }
+ this.duration = kwargs.duration ? kwargs.duration : DEFAULT_DURATION;
+ this.easing = kwargs.easing ? kwargs.easing : DEFAULT_EASING;
+ },
+
+ connect: function(){
+ // summary:
+ // Connect this action to the given plot.
+ this.handle = this.chart.connectToPlot(this.plot, this, "process");
+ },
+
+ disconnect: function(){
+ // summary:
+ // Disconnect this action from the given plot, if connected.
+ if(this.handle){
+ dojo.disconnect(this.handle);
+ this.handle = null;
+ }
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the action.
+ },
+
+ destroy: function(){
+ // summary:
+ // Do any cleanup needed when destroying parent elements.
+ this.disconnect();
+ df.forIn(this.anim, function(o){
+ df.forIn(o, function(anim){
+ anim.action.stop(true);
+ });
+ });
+ this.anim = {};
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/action2d/Highlight.js b/js/dojo-1.6/dojox/charting/action2d/Highlight.js
new file mode 100644
index 0000000..567c357
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Highlight.js
@@ -0,0 +1,139 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.Highlight"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Highlight"] = true;
+dojo.provide("dojox.charting.action2d.Highlight");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.color");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__HighlightCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // highlight: String|dojo.Color|Function?
+ // Either a color or a function that creates a color when highlighting happens.
+ highlight: null
+});
+=====*/
+(function(){
+ var DEFAULT_SATURATION = 100, // %
+ DEFAULT_LUMINOSITY1 = 75, // %
+ DEFAULT_LUMINOSITY2 = 50, // %
+
+ c = dojox.color,
+
+ cc = function(color){
+ return function(){ return color; };
+ },
+
+ hl = function(color){
+ var a = new c.Color(color),
+ x = a.toHsl();
+ if(x.s == 0){
+ x.l = x.l < 50 ? 100 : 0;
+ }else{
+ x.s = DEFAULT_SATURATION;
+ if(x.l < DEFAULT_LUMINOSITY2){
+ x.l = DEFAULT_LUMINOSITY1;
+ }else if(x.l > DEFAULT_LUMINOSITY1){
+ x.l = DEFAULT_LUMINOSITY2;
+ }else{
+ x.l = x.l - DEFAULT_LUMINOSITY2 > DEFAULT_LUMINOSITY1 - x.l ?
+ DEFAULT_LUMINOSITY2 : DEFAULT_LUMINOSITY1;
+ }
+ }
+ return c.fromHsl(x);
+ };
+
+ dojo.declare("dojox.charting.action2d.Highlight", dojox.charting.action2d.Base, {
+ // summary:
+ // Creates a highlighting action on a plot, where an element on that plot
+ // has a highlight on it.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut // easing for the action
+ },
+ optionalParams: {
+ highlight: "red" // name for the highlight color
+ // programmatic instantiation can use functions and color objects
+ },
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the highlighting action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__HighlightCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ var a = kwArgs && kwArgs.highlight;
+ this.colorFun = a ? (dojo.isFunction(a) ? a : cc(a)) : hl;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, anim, startFill, endFill;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ var color = o.shape.getFill();
+ if(!color || !(color instanceof dojo.Color)){
+ return;
+ }
+ this.anim[runName][index] = anim = {
+ start: color,
+ end: this.colorFun(color)
+ };
+ }
+
+ var start = anim.start, end = anim.end;
+ if(o.type == "onmouseout"){
+ // swap colors
+ var t = start;
+ start = end;
+ end = t;
+ }
+
+ anim.action = dojox.gfx.fx.animateFill({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ color: {start: start, end: end}
+ });
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/Highlight.xd.js b/js/dojo-1.6/dojox/charting/action2d/Highlight.xd.js
new file mode 100644
index 0000000..e846941
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Highlight.xd.js
@@ -0,0 +1,145 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.Highlight"],
+["require", "dojox.charting.action2d.Base"],
+["require", "dojox.color"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.Highlight"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Highlight"] = true;
+dojo.provide("dojox.charting.action2d.Highlight");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.color");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__HighlightCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // highlight: String|dojo.Color|Function?
+ // Either a color or a function that creates a color when highlighting happens.
+ highlight: null
+});
+=====*/
+(function(){
+ var DEFAULT_SATURATION = 100, // %
+ DEFAULT_LUMINOSITY1 = 75, // %
+ DEFAULT_LUMINOSITY2 = 50, // %
+
+ c = dojox.color,
+
+ cc = function(color){
+ return function(){ return color; };
+ },
+
+ hl = function(color){
+ var a = new c.Color(color),
+ x = a.toHsl();
+ if(x.s == 0){
+ x.l = x.l < 50 ? 100 : 0;
+ }else{
+ x.s = DEFAULT_SATURATION;
+ if(x.l < DEFAULT_LUMINOSITY2){
+ x.l = DEFAULT_LUMINOSITY1;
+ }else if(x.l > DEFAULT_LUMINOSITY1){
+ x.l = DEFAULT_LUMINOSITY2;
+ }else{
+ x.l = x.l - DEFAULT_LUMINOSITY2 > DEFAULT_LUMINOSITY1 - x.l ?
+ DEFAULT_LUMINOSITY2 : DEFAULT_LUMINOSITY1;
+ }
+ }
+ return c.fromHsl(x);
+ };
+
+ dojo.declare("dojox.charting.action2d.Highlight", dojox.charting.action2d.Base, {
+ // summary:
+ // Creates a highlighting action on a plot, where an element on that plot
+ // has a highlight on it.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut // easing for the action
+ },
+ optionalParams: {
+ highlight: "red" // name for the highlight color
+ // programmatic instantiation can use functions and color objects
+ },
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the highlighting action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__HighlightCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ var a = kwArgs && kwArgs.highlight;
+ this.colorFun = a ? (dojo.isFunction(a) ? a : cc(a)) : hl;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, anim, startFill, endFill;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ var color = o.shape.getFill();
+ if(!color || !(color instanceof dojo.Color)){
+ return;
+ }
+ this.anim[runName][index] = anim = {
+ start: color,
+ end: this.colorFun(color)
+ };
+ }
+
+ var start = anim.start, end = anim.end;
+ if(o.type == "onmouseout"){
+ // swap colors
+ var t = start;
+ start = end;
+ end = t;
+ }
+
+ anim.action = dojox.gfx.fx.animateFill({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ color: {start: start, end: end}
+ });
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/action2d/Magnify.js b/js/dojo-1.6/dojox/charting/action2d/Magnify.js
new file mode 100644
index 0000000..63549d1
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Magnify.js
@@ -0,0 +1,128 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.Magnify"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Magnify"] = true;
+dojo.provide("dojox.charting.action2d.Magnify");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+dojo.require("dojo.fx");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MagnifyCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to magnify the given object to. Default is 2.
+ scale: 2
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 2,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Magnify", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action that magnifies the object the action is applied to.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE // scale of magnification
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the magnifying action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot to apply the action to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MagnifyCtorArgs?
+ // Optional keyword arguments for this action.
+
+ // process optional named parameters
+ this.scale = kwArgs && typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the magnifying action.
+ if(!o.shape || !(o.type in this.overOutEvents) ||
+ !("cx" in o) || !("cy" in o)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim, init, scale;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ init = m.identity;
+ scale = this.scale;
+ }else{
+ init = m.scaleAt(this.scale, o.cx, o.cy);
+ scale = 1 / this.scale;
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "scaleAt", start: [1, o.cx, o.cy], end: [scale, o.cx, o.cy]},
+ init
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/Magnify.xd.js b/js/dojo-1.6/dojox/charting/action2d/Magnify.xd.js
new file mode 100644
index 0000000..816fd45
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Magnify.xd.js
@@ -0,0 +1,135 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.Magnify"],
+["require", "dojox.charting.action2d.Base"],
+["require", "dojox.gfx.matrix"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.Magnify"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Magnify"] = true;
+dojo.provide("dojox.charting.action2d.Magnify");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+dojo.require("dojo.fx");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MagnifyCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to magnify the given object to. Default is 2.
+ scale: 2
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 2,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Magnify", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action that magnifies the object the action is applied to.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE // scale of magnification
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the magnifying action.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot to apply the action to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MagnifyCtorArgs?
+ // Optional keyword arguments for this action.
+
+ // process optional named parameters
+ this.scale = kwArgs && typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the magnifying action.
+ if(!o.shape || !(o.type in this.overOutEvents) ||
+ !("cx" in o) || !("cy" in o)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim, init, scale;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ init = m.identity;
+ scale = this.scale;
+ }else{
+ init = m.scaleAt(this.scale, o.cx, o.cy);
+ scale = 1 / this.scale;
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "scaleAt", start: [1, o.cx, o.cy], end: [scale, o.cx, o.cy]},
+ init
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/action2d/MoveSlice.js b/js/dojo-1.6/dojox/charting/action2d/MoveSlice.js
new file mode 100644
index 0000000..e6cb999
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/MoveSlice.js
@@ -0,0 +1,139 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.MoveSlice"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.MoveSlice"] = true;
+dojo.provide("dojox.charting.action2d.MoveSlice");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+
+dojo.require("dojox.lang.functional");
+dojo.require("dojox.lang.functional.scan");
+dojo.require("dojox.lang.functional.fold");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MoveSliceCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to scale the pie slice. Default is 1.05.
+ scale: 1.05,
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 7.
+ shift: 7
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 1.05,
+ DEFAULT_SHIFT = 7, // px
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.MoveSlice", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action for a pie chart that moves and scales a pie slice.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE, // scale of magnification
+ shift: DEFAULT_SHIFT // shift of the slice
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the slice moving action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MoveSliceCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.scale = typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+ this.shift = typeof kwArgs.shift == "number" ? kwArgs.shift : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || o.element != "slice" || !(o.type in this.overOutEvents)){ return; }
+
+ if(!this.angles){
+ // calculate the running total of slice angles
+ var startAngle = m._degToRad(o.plot.opt.startAngle);
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+
+ var index = o.index, anim, startScale, endScale, startOffset, endOffset,
+ angle = (this.angles[index] + this.angles[index + 1]) / 2,
+ rotateTo0 = m.rotateAt(-angle, o.cx, o.cy),
+ rotateBack = m.rotateAt( angle, o.cx, o.cy);
+
+ anim = this.anim[index];
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ startOffset = 0;
+ endOffset = this.shift;
+ startScale = 1;
+ endScale = this.scale;
+ }else{
+ startOffset = this.shift;
+ endOffset = 0;
+ startScale = this.scale;
+ endScale = 1;
+ }
+
+ anim.action = dojox.gfx.fx.animateTransform({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ rotateBack,
+ {name: "translate", start: [startOffset, 0], end: [endOffset, 0]},
+ {name: "scaleAt", start: [startScale, o.cx, o.cy], end: [endScale, o.cx, o.cy]},
+ rotateTo0
+ ]
+ });
+
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ delete this.anim[index];
+ });
+ }
+ anim.action.play();
+ },
+
+ reset: function(){
+ delete this.angles;
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/MoveSlice.xd.js b/js/dojo-1.6/dojox/charting/action2d/MoveSlice.xd.js
new file mode 100644
index 0000000..332005f
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/MoveSlice.xd.js
@@ -0,0 +1,148 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.MoveSlice"],
+["require", "dojox.charting.action2d.Base"],
+["require", "dojox.gfx.matrix"],
+["require", "dojox.lang.functional"],
+["require", "dojox.lang.functional.scan"],
+["require", "dojox.lang.functional.fold"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.MoveSlice"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.MoveSlice"] = true;
+dojo.provide("dojox.charting.action2d.MoveSlice");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+
+dojo.require("dojox.lang.functional");
+dojo.require("dojox.lang.functional.scan");
+dojo.require("dojox.lang.functional.fold");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__MoveSliceCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // scale: Number?
+ // The amount to scale the pie slice. Default is 1.05.
+ scale: 1.05,
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 7.
+ shift: 7
+});
+=====*/
+(function(){
+ var DEFAULT_SCALE = 1.05,
+ DEFAULT_SHIFT = 7, // px
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx,
+ df = dojox.lang.functional;
+
+ dojo.declare("dojox.charting.action2d.MoveSlice", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action for a pie chart that moves and scales a pie slice.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ scale: DEFAULT_SCALE, // scale of magnification
+ shift: DEFAULT_SHIFT // shift of the slice
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the slice moving action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__MoveSliceCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.scale = typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;
+ this.shift = typeof kwArgs.shift == "number" ? kwArgs.shift : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || o.element != "slice" || !(o.type in this.overOutEvents)){ return; }
+
+ if(!this.angles){
+ // calculate the running total of slice angles
+ var startAngle = m._degToRad(o.plot.opt.startAngle);
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", startAngle),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+
+ var index = o.index, anim, startScale, endScale, startOffset, endOffset,
+ angle = (this.angles[index] + this.angles[index + 1]) / 2,
+ rotateTo0 = m.rotateAt(-angle, o.cx, o.cy),
+ rotateBack = m.rotateAt( angle, o.cx, o.cy);
+
+ anim = this.anim[index];
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[index] = anim = {};
+ }
+
+ if(o.type == "onmouseover"){
+ startOffset = 0;
+ endOffset = this.shift;
+ startScale = 1;
+ endScale = this.scale;
+ }else{
+ startOffset = this.shift;
+ endOffset = 0;
+ startScale = this.scale;
+ endScale = 1;
+ }
+
+ anim.action = dojox.gfx.fx.animateTransform({
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ rotateBack,
+ {name: "translate", start: [startOffset, 0], end: [endOffset, 0]},
+ {name: "scaleAt", start: [startScale, o.cx, o.cy], end: [endScale, o.cx, o.cy]},
+ rotateTo0
+ ]
+ });
+
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ delete this.anim[index];
+ });
+ }
+ anim.action.play();
+ },
+
+ reset: function(){
+ delete this.angles;
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/action2d/Shake.js b/js/dojo-1.6/dojox/charting/action2d/Shake.js
new file mode 100644
index 0000000..038854d
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Shake.js
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.Shake"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Shake"] = true;
+dojo.provide("dojox.charting.action2d.Shake");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+dojo.require("dojo.fx");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__ShakeCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 3.
+ shift: 3
+});
+=====*/
+(function(){
+ var DEFAULT_SHIFT = 3,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Shake", dojox.charting.action2d.Base, {
+ // summary:
+ // Create a shaking action for use on an element in a chart.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ shiftX: DEFAULT_SHIFT, // shift of the element along the X axis
+ shiftY: DEFAULT_SHIFT // shift of the element along the Y axis
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the shaking action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__ShakeCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.shiftX = typeof kwArgs.shiftX == "number" ? kwArgs.shiftX : DEFAULT_SHIFT;
+ this.shiftY = typeof kwArgs.shiftY == "number" ? kwArgs.shiftY : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim,
+ shiftX = o.type == "onmouseover" ? this.shiftX : -this.shiftX,
+ shiftY = o.type == "onmouseover" ? this.shiftY : -this.shiftY;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "translate", start: [this.shiftX, this.shiftY], end: [0, 0]},
+ m.identity
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/Shake.xd.js b/js/dojo-1.6/dojox/charting/action2d/Shake.xd.js
new file mode 100644
index 0000000..4b95b12
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Shake.xd.js
@@ -0,0 +1,129 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.Shake"],
+["require", "dojox.charting.action2d.Base"],
+["require", "dojox.gfx.matrix"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.Shake"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Shake"] = true;
+dojo.provide("dojox.charting.action2d.Shake");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+dojo.require("dojo.fx");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__ShakeCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for highlighting actions.
+
+ // shift: Number?
+ // The amount in pixels to shift the pie slice. Default is 3.
+ shift: 3
+});
+=====*/
+(function(){
+ var DEFAULT_SHIFT = 3,
+ m = dojox.gfx.matrix,
+ gf = dojox.gfx.fx;
+
+ dojo.declare("dojox.charting.action2d.Shake", dojox.charting.action2d.Base, {
+ // summary:
+ // Create a shaking action for use on an element in a chart.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ duration: 400, // duration of the action in ms
+ easing: dojo.fx.easing.backOut, // easing for the action
+ shiftX: DEFAULT_SHIFT, // shift of the element along the X axis
+ shiftY: DEFAULT_SHIFT // shift of the element along the Y axis
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the shaking action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__ShakeCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ if(!kwArgs){ kwArgs = {}; }
+ this.shiftX = typeof kwArgs.shiftX == "number" ? kwArgs.shiftX : DEFAULT_SHIFT;
+ this.shiftY = typeof kwArgs.shiftY == "number" ? kwArgs.shiftY : DEFAULT_SHIFT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the slice moving action.
+ if(!o.shape || !(o.type in this.overOutEvents)){ return; }
+
+ var runName = o.run.name, index = o.index, vector = [], anim,
+ shiftX = o.type == "onmouseover" ? this.shiftX : -this.shiftX,
+ shiftY = o.type == "onmouseover" ? this.shiftY : -this.shiftY;
+
+ if(runName in this.anim){
+ anim = this.anim[runName][index];
+ }else{
+ this.anim[runName] = {};
+ }
+
+ if(anim){
+ anim.action.stop(true);
+ }else{
+ this.anim[runName][index] = anim = {};
+ }
+
+ var kwArgs = {
+ shape: o.shape,
+ duration: this.duration,
+ easing: this.easing,
+ transform: [
+ {name: "translate", start: [this.shiftX, this.shiftY], end: [0, 0]},
+ m.identity
+ ]
+ };
+ if(o.shape){
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.oultine){
+ kwArgs.shape = o.outline;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+ if(o.shadow){
+ kwArgs.shape = o.shadow;
+ vector.push(gf.animateTransform(kwArgs));
+ }
+
+ if(!vector.length){
+ delete this.anim[runName][index];
+ return;
+ }
+
+ anim.action = dojo.fx.combine(vector);
+ if(o.type == "onmouseout"){
+ dojo.connect(anim.action, "onEnd", this, function(){
+ if(this.anim[runName]){
+ delete this.anim[runName][index];
+ }
+ });
+ }
+ anim.action.play();
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/charting/action2d/Tooltip.js b/js/dojo-1.6/dojox/charting/action2d/Tooltip.js
new file mode 100644
index 0000000..571b64a
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Tooltip.js
@@ -0,0 +1,170 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.charting.action2d.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Tooltip"] = true;
+dojo.provide("dojox.charting.action2d.Tooltip");
+
+dojo.require("dijit.Tooltip");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+
+dojo.require("dojox.lang.functional");
+dojo.require("dojox.lang.functional.scan");
+dojo.require("dojox.lang.functional.fold");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__TooltipCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for tooltip actions.
+
+ // text: Function?
+ // The function that produces the text to be shown within a tooltip. By default this will be
+ // set by the plot in question, by returning the value of the element.
+ text: null
+});
+=====*/
+(function(){
+ var DEFAULT_TEXT = function(o){
+ var t = o.run && o.run.data && o.run.data[o.index];
+ if(t && typeof t != "number" && (t.tooltip || t.text)){
+ return t.tooltip || t.text;
+ }
+ if(o.element == "candlestick"){
+ return '<table cellpadding="1" cellspacing="0" border="0" style="font-size:0.9em;">'
+ + '<tr><td>Open:</td><td align="right"><strong>' + o.data.open + '</strong></td></tr>'
+ + '<tr><td>High:</td><td align="right"><strong>' + o.data.high + '</strong></td></tr>'
+ + '<tr><td>Low:</td><td align="right"><strong>' + o.data.low + '</strong></td></tr>'
+ + '<tr><td>Close:</td><td align="right"><strong>' + o.data.close + '</strong></td></tr>'
+ + (o.data.mid !== undefined ? '<tr><td>Mid:</td><td align="right"><strong>' + o.data.mid + '</strong></td></tr>' : '')
+ + '</table>';
+ }
+ return o.element == "bar" ? o.x : o.y;
+ };
+
+ var df = dojox.lang.functional, m = dojox.gfx.matrix, pi4 = Math.PI / 4, pi2 = Math.PI / 2;
+
+ dojo.declare("dojox.charting.action2d.Tooltip", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action on a plot where a tooltip is shown when hovering over an element.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ text: DEFAULT_TEXT // the function to produce a tooltip from the object
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the tooltip action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__TooltipCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ this.text = kwArgs && kwArgs.text ? kwArgs.text : DEFAULT_TEXT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(o.type === "onplotreset" || o.type === "onmouseout"){
+ dijit.hideTooltip(this.aroundRect);
+ this.aroundRect = null;
+ if(o.type === "onplotreset"){
+ delete this.angles;
+ }
+ return;
+ }
+
+ if(!o.shape || o.type !== "onmouseover"){ return; }
+
+ // calculate relative coordinates and the position
+ var aroundRect = {type: "rect"}, position = ["after", "before"];
+ switch(o.element){
+ case "marker":
+ aroundRect.x = o.cx;
+ aroundRect.y = o.cy;
+ aroundRect.width = aroundRect.height = 1;
+ break;
+ case "circle":
+ aroundRect.x = o.cx - o.cr;
+ aroundRect.y = o.cy - o.cr;
+ aroundRect.width = aroundRect.height = 2 * o.cr;
+ break;
+ case "column":
+ position = ["above", "below"];
+ // intentional fall down
+ case "bar":
+ aroundRect = dojo.clone(o.shape.getShape());
+ break;
+ case "candlestick":
+ aroundRect.x = o.x;
+ aroundRect.y = o.y;
+ aroundRect.width = o.width;
+ aroundRect.height = o.height;
+ break;
+ default:
+ //case "slice":
+ if(!this.angles){
+ // calculate the running total of slice angles
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+ var startAngle = m._degToRad(o.plot.opt.startAngle),
+ angle = (this.angles[o.index] + this.angles[o.index + 1]) / 2 + startAngle;
+ aroundRect.x = o.cx + o.cr * Math.cos(angle);
+ aroundRect.y = o.cy + o.cr * Math.sin(angle);
+ aroundRect.width = aroundRect.height = 1;
+ // calculate the position
+ if(angle < pi4){
+ // do nothing: the position is right
+ }else if(angle < pi2 + pi4){
+ position = ["below", "above"];
+ }else if(angle < Math.PI + pi4){
+ position = ["before", "after"];
+ }else if(angle < 2 * Math.PI - pi4){
+ position = ["above", "below"];
+ }
+ /*
+ else{
+ // do nothing: the position is right
+ }
+ */
+ break;
+ }
+
+ // adjust relative coordinates to absolute, and remove fractions
+ var lt = dojo.coords(this.chart.node, true);
+ aroundRect.x += lt.x;
+ aroundRect.y += lt.y;
+ aroundRect.x = Math.round(aroundRect.x);
+ aroundRect.y = Math.round(aroundRect.y);
+ aroundRect.width = Math.ceil(aroundRect.width);
+ aroundRect.height = Math.ceil(aroundRect.height);
+ this.aroundRect = aroundRect;
+
+ var tooltip = this.text(o);
+ if(tooltip){
+ dijit.showTooltip(tooltip, this.aroundRect, position);
+ }
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/charting/action2d/Tooltip.xd.js b/js/dojo-1.6/dojox/charting/action2d/Tooltip.xd.js
new file mode 100644
index 0000000..2f7f594
--- /dev/null
+++ b/js/dojo-1.6/dojox/charting/action2d/Tooltip.xd.js
@@ -0,0 +1,180 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.charting.action2d.Tooltip"],
+["require", "dijit.Tooltip"],
+["require", "dojox.charting.action2d.Base"],
+["require", "dojox.gfx.matrix"],
+["require", "dojox.lang.functional"],
+["require", "dojox.lang.functional.scan"],
+["require", "dojox.lang.functional.fold"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.charting.action2d.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.charting.action2d.Tooltip"] = true;
+dojo.provide("dojox.charting.action2d.Tooltip");
+
+dojo.require("dijit.Tooltip");
+
+dojo.require("dojox.charting.action2d.Base");
+dojo.require("dojox.gfx.matrix");
+
+dojo.require("dojox.lang.functional");
+dojo.require("dojox.lang.functional.scan");
+dojo.require("dojox.lang.functional.fold");
+
+/*=====
+dojo.declare("dojox.charting.action2d.__TooltipCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
+ // summary:
+ // Additional arguments for tooltip actions.
+
+ // text: Function?
+ // The function that produces the text to be shown within a tooltip. By default this will be
+ // set by the plot in question, by returning the value of the element.
+ text: null
+});
+=====*/
+(function(){
+ var DEFAULT_TEXT = function(o){
+ var t = o.run && o.run.data && o.run.data[o.index];
+ if(t && typeof t != "number" && (t.tooltip || t.text)){
+ return t.tooltip || t.text;
+ }
+ if(o.element == "candlestick"){
+ return '<table cellpadding="1" cellspacing="0" border="0" style="font-size:0.9em;">'
+ + '<tr><td>Open:</td><td align="right"><strong>' + o.data.open + '</strong></td></tr>'
+ + '<tr><td>High:</td><td align="right"><strong>' + o.data.high + '</strong></td></tr>'
+ + '<tr><td>Low:</td><td align="right"><strong>' + o.data.low + '</strong></td></tr>'
+ + '<tr><td>Close:</td><td align="right"><strong>' + o.data.close + '</strong></td></tr>'
+ + (o.data.mid !== undefined ? '<tr><td>Mid:</td><td align="right"><strong>' + o.data.mid + '</strong></td></tr>' : '')
+ + '</table>';
+ }
+ return o.element == "bar" ? o.x : o.y;
+ };
+
+ var df = dojox.lang.functional, m = dojox.gfx.matrix, pi4 = Math.PI / 4, pi2 = Math.PI / 2;
+
+ dojo.declare("dojox.charting.action2d.Tooltip", dojox.charting.action2d.Base, {
+ // summary:
+ // Create an action on a plot where a tooltip is shown when hovering over an element.
+
+ // the data description block for the widget parser
+ defaultParams: {
+ text: DEFAULT_TEXT // the function to produce a tooltip from the object
+ },
+ optionalParams: {}, // no optional parameters
+
+ constructor: function(chart, plot, kwArgs){
+ // summary:
+ // Create the tooltip action and connect it to the plot.
+ // chart: dojox.charting.Chart2D
+ // The chart this action belongs to.
+ // plot: String?
+ // The plot this action is attached to. If not passed, "default" is assumed.
+ // kwArgs: dojox.charting.action2d.__TooltipCtorArgs?
+ // Optional keyword arguments object for setting parameters.
+ this.text = kwArgs && kwArgs.text ? kwArgs.text : DEFAULT_TEXT;
+
+ this.connect();
+ },
+
+ process: function(o){
+ // summary:
+ // Process the action on the given object.
+ // o: dojox.gfx.Shape
+ // The object on which to process the highlighting action.
+ if(o.type === "onplotreset" || o.type === "onmouseout"){
+ dijit.hideTooltip(this.aroundRect);
+ this.aroundRect = null;
+ if(o.type === "onplotreset"){
+ delete this.angles;
+ }
+ return;
+ }
+
+ if(!o.shape || o.type !== "onmouseover"){ return; }
+
+ // calculate relative coordinates and the position
+ var aroundRect = {type: "rect"}, position = ["after", "before"];
+ switch(o.element){
+ case "marker":
+ aroundRect.x = o.cx;
+ aroundRect.y = o.cy;
+ aroundRect.width = aroundRect.height = 1;
+ break;
+ case "circle":
+ aroundRect.x = o.cx - o.cr;
+ aroundRect.y = o.cy - o.cr;
+ aroundRect.width = aroundRect.height = 2 * o.cr;
+ break;
+ case "column":
+ position = ["above", "below"];
+ // intentional fall down
+ case "bar":
+ aroundRect = dojo.clone(o.shape.getShape());
+ break;
+ case "candlestick":
+ aroundRect.x = o.x;
+ aroundRect.y = o.y;
+ aroundRect.width = o.width;
+ aroundRect.height = o.height;
+ break;
+ default:
+ //case "slice":
+ if(!this.angles){
+ // calculate the running total of slice angles
+ if(typeof o.run.data[0] == "number"){
+ this.angles = df.map(df.scanl(o.run.data, "+", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "+", 0));
+ }else{
+ this.angles = df.map(df.scanl(o.run.data, "a + b.y", 0),
+ "* 2 * Math.PI / this", df.foldl(o.run.data, "a + b.y", 0));
+ }
+ }
+ var startAngle = m._degToRad(o.plot.opt.startAngle),
+ angle = (this.angles[o.index] + this.angles[o.index + 1]) / 2 + startAngle;
+ aroundRect.x = o.cx + o.cr * Math.cos(angle);
+ aroundRect.y = o.cy + o.cr * Math.sin(angle);
+ aroundRect.width = aroundRect.height = 1;
+ // calculate the position
+ if(angle < pi4){
+ // do nothing: the position is right
+ }else if(angle < pi2 + pi4){
+ position = ["below", "above"];
+ }else if(angle < Math.PI + pi4){
+ position = ["before", "after"];
+ }else if(angle < 2 * Math.PI - pi4){
+ position = ["above", "below"];
+ }
+ /*
+ else{
+ // do nothing: the position is right
+ }
+ */
+ break;
+ }
+
+ // adjust relative coordinates to absolute, and remove fractions
+ var lt = dojo.coords(this.chart.node, true);
+ aroundRect.x += lt.x;
+ aroundRect.y += lt.y;
+ aroundRect.x = Math.round(aroundRect.x);
+ aroundRect.y = Math.round(aroundRect.y);
+ aroundRect.width = Math.ceil(aroundRect.width);
+ aroundRect.height = Math.ceil(aroundRect.height);
+ this.aroundRect = aroundRect;
+
+ var tooltip = this.text(o);
+ if(tooltip){
+ dijit.showTooltip(tooltip, this.aroundRect, position);
+ }
+ }
+ });
+})();
+
+}
+
+}};});