Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes for js in. Need to change as.

  • Loading branch information...
commit 8d273b56771486c316390b7e2971611d4185e144 1 parent a53164c
trippb authored
View
BIN  build/charts/assets/charts.swf
Binary file not shown
View
1,059 build/charts/charts-debug.js
@@ -1,737 +1,3 @@
-/*extern ActiveXObject, __flash_unloadHandler, __flash_savedUnloadHandler */
-/*!
- * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
- *
- * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
- * @namespace YAHOO
- */
-
-YAHOO.namespace("deconcept");
-
-YAHOO.deconcept = YAHOO.deconcept || {};
-
-if(typeof YAHOO.deconcept.util == "undefined" || !YAHOO.deconcept.util)
-{
- YAHOO.deconcept.util = {};
-}
-
-if(typeof YAHOO.deconcept.SWFObjectUtil == "undefined" || !YAHOO.deconcept.SWFObjectUtil)
-{
- YAHOO.deconcept.SWFObjectUtil = {};
-}
-
-YAHOO.deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey)
-{
- if(!document.getElementById) { return; }
- this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
- this.skipDetect = YAHOO.deconcept.util.getRequestParameter(this.DETECT_KEY);
- this.params = {};
- this.variables = {};
- this.attributes = [];
- if(swf) { this.setAttribute('swf', swf); }
- if(id) { this.setAttribute('id', id); }
- if(w) { this.setAttribute('width', w); }
- if(h) { this.setAttribute('height', h); }
- if(ver) { this.setAttribute('version', new YAHOO.deconcept.PlayerVersion(ver.toString().split("."))); }
- this.installedVer = YAHOO.deconcept.SWFObjectUtil.getPlayerVersion();
- if (!window.opera && document.all && this.installedVer.major > 7)
- {
- // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
- YAHOO.deconcept.SWFObject.doPrepUnload = true;
- }
- if(c)
- {
- this.addParam('bgcolor', c);
- }
- var q = quality ? quality : 'high';
- this.addParam('quality', q);
- this.setAttribute('useExpressInstall', false);
- this.setAttribute('doExpressInstall', false);
- var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
- this.setAttribute('xiRedirectUrl', xir);
- this.setAttribute('redirectUrl', '');
- if(redirectUrl)
- {
- this.setAttribute('redirectUrl', redirectUrl);
- }
-};
-
-YAHOO.deconcept.SWFObject.prototype =
-{
- useExpressInstall: function(path)
- {
- this.xiSWFPath = !path ? "expressinstall.swf" : path;
- this.setAttribute('useExpressInstall', true);
- },
- setAttribute: function(name, value){
- this.attributes[name] = value;
- },
- getAttribute: function(name){
- return this.attributes[name];
- },
- addParam: function(name, value){
- this.params[name] = value;
- },
- getParams: function(){
- return this.params;
- },
- addVariable: function(name, value){
- this.variables[name] = value;
- },
- getVariable: function(name){
- return this.variables[name];
- },
- getVariables: function(){
- return this.variables;
- },
- getVariablePairs: function(){
- var variablePairs = [];
- var key;
- var variables = this.getVariables();
- for(key in variables)
- {
- if(variables.hasOwnProperty(key))
- {
- variablePairs[variablePairs.length] = key +"="+ variables[key];
- }
- }
- return variablePairs;
- },
- getSWFHTML: function() {
- var swfNode = "";
- var params = {};
- var key = "";
- var pairs = "";
- if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
- if (this.getAttribute("doExpressInstall")) {
- this.addVariable("MMplayerType", "PlugIn");
- this.setAttribute('swf', this.xiSWFPath);
- }
- swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
- swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
- params = this.getParams();
- for(key in params)
- {
- if(params.hasOwnProperty(key))
- {
- swfNode += [key] +'="'+ params[key] +'" ';
- }
- }
- pairs = this.getVariablePairs().join("&");
- if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
- swfNode += '/>';
- } else { // PC IE
- if (this.getAttribute("doExpressInstall")) {
- this.addVariable("MMplayerType", "ActiveX");
- this.setAttribute('swf', this.xiSWFPath);
- }
- swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
- swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
- params = this.getParams();
- for(key in params)
- {
- if(params.hasOwnProperty(key))
- {
- swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
- }
- }
- pairs = this.getVariablePairs().join("&");
- if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
- swfNode += "</object>";
- }
- return swfNode;
- },
- write: function(elementId)
- {
- if(this.getAttribute('useExpressInstall')) {
- // check to see if we need to do an express install
- var expressInstallReqVer = new YAHOO.deconcept.PlayerVersion([6,0,65]);
- if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
- this.setAttribute('doExpressInstall', true);
- this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
- document.title = document.title.slice(0, 47) + " - Flash Player Installation";
- this.addVariable("MMdoctitle", document.title);
- }
- }
- if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version')))
- {
- var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
- n.innerHTML = this.getSWFHTML();
- return true;
- }
- else
- {
- if(this.getAttribute('redirectUrl') !== "")
- {
- document.location.replace(this.getAttribute('redirectUrl'));
- }
- }
- return false;
- }
-};
-
-/* ---- detection functions ---- */
-YAHOO.deconcept.SWFObjectUtil.getPlayerVersion = function()
-{
- var axo = null;
- var PlayerVersion = new YAHOO.deconcept.PlayerVersion([0,0,0]);
- if(navigator.plugins && navigator.mimeTypes.length)
- {
- var x = navigator.plugins["Shockwave Flash"];
- if(x && x.description)
- {
- PlayerVersion = new YAHOO.deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
- }
- }
- else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0)
- { // if Windows CE
- var counter = 3;
- while(axo)
- {
- try
- {
- counter++;
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
-// document.write("player v: "+ counter);
- PlayerVersion = new YAHOO.deconcept.PlayerVersion([counter,0,0]);
- }
- catch(e)
- {
- axo = null;
- }
- }
- }
- else
- { // Win IE (non mobile)
- // do minor version lookup in IE, but avoid fp6 crashing issues
- // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
- }
- catch(e)
- {
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
- PlayerVersion = new YAHOO.deconcept.PlayerVersion([6,0,21]);
- axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
- }
- catch(e)
- {
- if(PlayerVersion.major == 6)
- {
- return PlayerVersion;
- }
- }
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
- }
- catch(e) {}
- }
-
- if(axo !== null)
- {
- PlayerVersion = new YAHOO.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
- }
- }
- return PlayerVersion;
-};
-
-YAHOO.deconcept.PlayerVersion = function(arrVersion)
-{
- this.major = arrVersion[0] !== null ? parseInt(arrVersion[0], 0) : 0;
- this.minor = arrVersion[1] !== null ? parseInt(arrVersion[1], 0) : 0;
- this.rev = arrVersion[2] !== null ? parseInt(arrVersion[2], 0) : 0;
-};
-
-YAHOO.deconcept.PlayerVersion.prototype.versionIsValid = function(fv)
-{
- if(this.major < fv.major)
- {
- return false;
- }
- if(this.major > fv.major)
- {
- return true;
- }
- if(this.minor < fv.minor)
- {
- return false;
- }
- if(this.minor > fv.minor)
- {
- return true;
- }
- if(this.rev < fv.rev)
- {
- return false;
- }
- return true;
-};
-
-/* ---- get value of query string param ---- */
-YAHOO.deconcept.util =
-{
- getRequestParameter: function(param)
- {
- var q = document.location.search || document.location.hash;
- if(param === null) { return q; }
- if(q)
- {
- var pairs = q.substring(1).split("&");
- for(var i=0; i < pairs.length; i++)
- {
- if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
- {
- return pairs[i].substring((pairs[i].indexOf("=") + 1));
- }
- }
- }
- return "";
- }
-};
-
-/* fix for video streaming bug */
-YAHOO.deconcept.SWFObjectUtil.cleanupSWFs = function()
-{
- var objects = document.getElementsByTagName("OBJECT");
- for(var i = objects.length - 1; i >= 0; i--)
- {
- objects[i].style.display = 'none';
- for(var x in objects[i])
- {
- if(typeof objects[i][x] == 'function')
- {
- objects[i][x] = function(){};
- }
- }
- }
-};
-
-// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
-if(YAHOO.deconcept.SWFObject.doPrepUnload)
-{
- if(!YAHOO.deconcept.unloadSet)
- {
- YAHOO.deconcept.SWFObjectUtil.prepUnload = function()
- {
- __flash_unloadHandler = function(){};
- __flash_savedUnloadHandler = function(){};
- window.attachEvent("onunload", YAHOO.deconcept.SWFObjectUtil.cleanupSWFs);
- };
- window.attachEvent("onbeforeunload", YAHOO.deconcept.SWFObjectUtil.prepUnload);
- YAHOO.deconcept.unloadSet = true;
- }
-}
-
-/* add document.getElementById if needed (mobile IE < 5) */
-if(!document.getElementById && document.all)
-{
- document.getElementById = function(id) { return document.all[id]; };
-}
-
-/**
- * Wraps Flash embedding functionality and allows communication with SWF through
- * attributes.
- *
- * @namespace YAHOO.widget
- * @class FlashAdapter
- * @uses YAHOO.util.AttributeProvider
- */
-YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
-{
- // set up the initial events and attributes stuff
- this._queue = this._queue || [];
- this._events = this._events || {};
- this._configs = this._configs || {};
- attributes = attributes || {};
-
- //the Flash Player external interface code from Adobe doesn't play nicely
- //with the default value, yui-gen, in IE
- this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
- attributes.version = attributes.version || "9.0.45";
- attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
-
- //we can't use the initial attributes right away
- //so save them for once the SWF finishes loading
- this._attributes = attributes;
-
- this._swfURL = swfURL;
- this._containerID = containerID;
-
- //embed the SWF file in the page
- this._embedSWF(this._swfURL, this._containerID, attributes.id, attributes.version,
- attributes.backgroundColor, attributes.expressInstall, attributes.wmode);
-
- /**
- * Fires when the SWF is initialized and communication is possible.
- * @event contentReady
- */
- //Fix for iframe cross-domain issue with FF2x
- try
- {
- this.createEvent("contentReady");
- }
- catch(e){}
-};
-
-YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
-{
- /**
- * The URL of the SWF file.
- * @property _swfURL
- * @type String
- * @private
- */
- _swfURL: null,
-
- /**
- * The ID of the containing DIV.
- * @property _containerID
- * @type String
- * @private
- */
- _containerID: null,
-
- /**
- * A reference to the embedded SWF file.
- * @property _swf
- * @private
- */
- _swf: null,
-
- /**
- * The id of this instance.
- * @property _id
- * @type String
- * @private
- */
- _id: null,
-
- /**
- * Indicates whether the SWF has been initialized and is ready
- * to communicate with JavaScript
- * @property _initialized
- * @type Boolean
- * @private
- */
- _initialized: false,
-
- /**
- * The initializing attributes are stored here until the SWF is ready.
- * @property _attributes
- * @type Object
- * @private
- */
- _attributes: null, //the intializing attributes
-
- /**
- * Public accessor to the unique name of the FlashAdapter instance.
- *
- * @method toString
- * @return {String} Unique name of the FlashAdapter instance.
- */
- toString: function()
- {
- return "FlashAdapter " + this._id;
- },
-
- /**
- * Nulls out the entire FlashAdapter instance and related objects and removes attached
- * event listeners and clears out DOM elements inside the container. After calling
- * this method, the instance reference should be expliclitly nulled by implementer,
- * as in myChart = null. Use with caution!
- *
- * @method destroy
- */
- destroy: function()
- {
- //kill the Flash Player instance
- if(this._swf)
- {
- var container = YAHOO.util.Dom.get(this._containerID);
- container.removeChild(this._swf);
- }
-
- var instanceName = this._id;
-
- //null out properties
- for(var prop in this)
- {
- if(YAHOO.lang.hasOwnProperty(this, prop))
- {
- this[prop] = null;
- }
- }
-
- YAHOO.log("FlashAdapter instance destroyed: " + instanceName);
- },
-
- /**
- * Embeds the SWF in the page and associates it with this instance.
- *
- * @method _embedSWF
- * @private
- */
- _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode)
- {
- //standard SWFObject embed
- var swfObj = new YAHOO.deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor);
-
- if(expressInstall)
- {
- swfObj.useExpressInstall(expressInstall);
- }
-
- //make sure we can communicate with ExternalInterface
- swfObj.addParam("allowScriptAccess", "always");
-
- if(wmode)
- {
- swfObj.addParam("wmode", wmode);
- }
-
- //again, a useful ExternalInterface trick
- swfObj.addVariable("allowedDomain", document.location.hostname);
-
- //tell the SWF which HTML element it is in
- swfObj.addVariable("elementID", swfID);
-
- // set the name of the function to call when the swf has an event
- swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
-
- var container = YAHOO.util.Dom.get(containerID);
- var result = swfObj.write(container);
- if(result)
- {
- this._swf = YAHOO.util.Dom.get(swfID);
- //if successful, let's add an owner property to the SWF reference
- //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
- this._swf.owner = this;
- }
- else
- {
- YAHOO.log("Unable to load SWF " + swfURL);
- }
- },
-
- /**
- * Handles or re-dispatches events received from the SWF.
- *
- * @method _eventHandler
- * @private
- */
- _eventHandler: function(event)
- {
- var type = event.type;
- switch(type)
- {
- case "swfReady":
- this._loadHandler();
- this.fireEvent("contentReady");
- return;
- case "log":
- YAHOO.log(event.message, event.category, this.toString());
- return;
- }
-
- //be sure to return after your case or the event will automatically fire!
- this.fireEvent(type, event);
- },
-
- /**
- * Called when the SWF has been initialized.
- *
- * @method _loadHandler
- * @private
- */
- _loadHandler: function()
- {
- this._initialized = false;
- this._initAttributes(this._attributes);
- this.setAttributes(this._attributes, true);
-
- this._initialized = true;
- },
-
- set: function(name, value)
- {
- //save all the attributes in case the swf reloads
- //so that we can pass them in again
- this._attributes[name] = value;
- YAHOO.widget.FlashAdapter.superclass.set.call(this, name, value);
- },
-
- /**
- * Initializes the attributes.
- *
- * @method _initAttributes
- * @private
- */
- _initAttributes: function(attributes)
- {
- //should be overridden if other attributes need to be set up
-
- /**
- * @attribute wmode
- * @description Sets the window mode of the Flash Player control. May be
- * "window", "opaque", or "transparent". Only available in the constructor
- * because it may not be set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute expressInstall
- * @description URL pointing to a SWF file that handles Flash Player's express
- * install feature. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute version
- * @description Minimum required version for the SWF file. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute backgroundColor
- * @description The background color of the SWF. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute altText
- * @description The alternative text to provide for screen readers and other assistive technology.
- * @type String
- */
- this.getAttributeConfig("altText",
- {
- method: this._getAltText
- });
- this.setAttributeConfig("altText",
- {
- method: this._setAltText
- });
-
- /**
- * @attribute swfURL
- * @description Absolute or relative URL to the SWF displayed by the FlashAdapter. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
- this.getAttributeConfig("swfURL",
- {
- method: this._getSWFURL
- });
- },
-
- /**
- * Getter for swfURL attribute.
- *
- * @method _getSWFURL
- * @private
- */
- _getSWFURL: function()
- {
- return this._swfURL;
- },
-
- /**
- * Getter for altText attribute.
- *
- * @method _getAltText
- * @private
- */
- _getAltText: function()
- {
- return this._swf.getAltText();
- },
-
- /**
- * Setter for altText attribute.
- *
- * @method _setAltText
- * @private
- */
- _setAltText: function(value)
- {
- return this._swf.setAltText(value);
- }
-});
-
-/**
- * Receives event messages from SWF and passes them to the correct instance
- * of FlashAdapter.
- *
- * @method YAHOO.widget.FlashAdapter.eventHandler
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
-{
- var loadedSWF = YAHOO.util.Dom.get(elementID);
- if(!loadedSWF.owner)
- {
- //fix for ie: if owner doesn't exist yet, try again in a moment
- setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
- }
- else
- {
- loadedSWF.owner._eventHandler(event);
- }
-};
-
-/**
- * The number of proxy functions that have been created.
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.proxyFunctionCount = 0;
-
-/**
- * Creates a globally accessible function that wraps a function reference.
- * Returns the proxy function's name as a string for use by the SWF through
- * ExternalInterface.
- *
- * @method YAHOO.widget.FlashAdapter.createProxyFunction
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.createProxyFunction = function(func)
-{
- var index = YAHOO.widget.FlashAdapter.proxyFunctionCount;
- YAHOO.widget.FlashAdapter["proxyFunction" + index] = function()
- {
- return func.apply(null, arguments);
- };
- YAHOO.widget.FlashAdapter.proxyFunctionCount++;
- return "YAHOO.widget.FlashAdapter.proxyFunction" + index.toString();
-};
-
-/**
- * Removes a function created with createProxyFunction()
- *
- * @method YAHOO.widget.FlashAdapter.removeProxyFunction
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
-{
- //quick error check
- if(!funcName || funcName.indexOf("YAHOO.widget.FlashAdapter.proxyFunction") < 0)
- {
- return;
- }
-
- funcName = funcName.substr(26);
- YAHOO.widget.FlashAdapter[funcName] = null;
-};
/**
* The Charts widget provides a Flash control for displaying data
* graphically by series across A-grade browsers with Flash Player installed.
@@ -751,7 +17,7 @@ YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
*
* @namespace YAHOO.widget
* @class Chart
- * @uses YAHOO.widget.FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
* @constructor
* @param type {String} The char type. May be "line", "column", "bar", or "pie"
* @param containerId {HTMLElement} Container element for the Flash Player instance.
@@ -760,11 +26,29 @@ YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
*/
YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
{
- YAHOO.widget.Chart.superclass.constructor.call(this, YAHOO.widget.Chart.SWFURL, containerId, attributes);
+ this._attributes = attributes;
+ this._swfEmbed = new YAHOO.widget.SWF(containerId, YAHOO.widget.Chart.SWFURL, attributes);
+
+ this._swf = this._swfEmbed.swf;
+ //this._swfEmbed.on("swfReady", this._eventHandler);
+ this._swfEmbed.addListener("swfReady", this._eventHandler, null, this);
+ //this._swfEmbed.on("log", this._eventHandler);
this._type = type;
this._dataSource = dataSource;
+
+ /**
+ * Fires when the SWF is initialized and communication is possible.
+ * @event contentReady
+ */
+ //Fix for iframe cross-domain issue with FF2x
+ try
+ {
+ this.createEvent("contentReady");
+ }
+ catch(e){}
+
/**
* Fires when the user moves the mouse over the bounds of an item renderer in the chart.
*
@@ -857,7 +141,7 @@ YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
this.createEvent("itemDragEndEvent");
};
-YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
+YAHOO.extend(YAHOO.widget.Chart, YAHOO.util.AttributeProvider,
{
/**
* The type of this chart instance.
@@ -885,7 +169,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
/**
* Stores a reference to the dataTipFunction created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _dataTipFunction
* @type String
* @private
@@ -894,7 +178,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
/**
* Stores references to series labelFunction values created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _seriesLabelFunctions
* @type Array
* @private
@@ -973,11 +257,26 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
//remove proxy functions
if(this._dataTipFunction)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);
+ YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);
}
- //call last
- YAHOO.widget.Chart.superclass.destroy.call(this);
+ //kill the Flash Player instance
+ if(this._swf)
+ {
+ var container = YAHOO.util.Dom.get(this._containerID);
+ container.removeChild(this._swf);
+ }
+
+ var instanceName = this._id;
+
+ //null out properties
+ for(var prop in this)
+ {
+ if(YAHOO.lang.hasOwnProperty(this, prop))
+ {
+ this[prop] = null;
+ }
+ }
},
/**
@@ -988,7 +287,61 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
*/
_initAttributes: function(attributes)
{
- YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+ //YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+ /**
+ * @attribute wmode
+ * @description Sets the window mode of the Flash Player control. May be
+ * "window", "opaque", or "transparent". Only available in the constructor
+ * because it may not be set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute expressInstall
+ * @description URL pointing to a SWF file that handles Flash Player's express
+ * install feature. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute version
+ * @description Minimum required version for the SWF file. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute backgroundColor
+ * @description The background color of the SWF. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute altText
+ * @description The alternative text to provide for screen readers and other assistive technology.
+ * @type String
+ */
+ this.getAttributeConfig("altText",
+ {
+ method: this._getAltText
+ });
+ this.setAttributeConfig("altText",
+ {
+ method: this._setAltText
+ });
+
+ /**
+ * @attribute swfURL
+ * @description Absolute or relative URL to the SWF displayed by the Chart. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+ this.getAttributeConfig("swfURL",
+ {
+ method: this._getSWFURL
+ });
/**
* @attribute request
@@ -1085,6 +438,29 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
},
/**
+ * Handles or re-dispatches events received from the SWF.
+ *
+ * @method _eventHandler
+ * @private
+ */
+ _eventHandler: function(event)
+ {
+ var type = event.type;
+ switch(type)
+ {
+ case "swfReady":
+ this._swf = this._swfEmbed._swf;
+ this._loadHandler();
+ this.fireEvent("contentReady");
+ return;
+ case "log":
+ YAHOO.log(event.message, event.category, this.toString());
+ this.fireEvent(type, event);
+ return;
+ }
+ },
+
+ /**
* Called when the SWF is ready for communication. Sets the type, initializes
* the styles, and sets the DataSource.
*
@@ -1095,21 +471,26 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
//the type is set separately because it must be first!
this._swf.setType(this._type);
-
+
+
//set initial styles
if(this._attributes.style)
{
var style = this._attributes.style;
this.setStyles(style);
}
-
- YAHOO.widget.Chart.superclass._loadHandler.call(this);
-
+
+ this._initialized = false;
+
+ this._initAttributes(this._attributes);
+ this.setAttributes(this._attributes, true);
+
+ this._initialized = true;
if(this._dataSource)
{
this.set("dataSource", this._dataSource);
}
- },
+ },
/**
* Sends (or resends) the request to the DataSource.
@@ -1162,7 +543,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
var count = this._seriesLabelFunctions.length;
for(i = 0; i < count; i++)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._seriesLabelFunctions[i]);
+ YAHOO.widget.Chart.removeProxyFunction(this._seriesLabelFunctions[i]);
}
this._seriesLabelFunction = null;
}
@@ -1197,7 +578,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
if(currentSeries.labelFunction !== null &&
typeof currentSeries.labelFunction == "function")
{
- clonedSeries.labelFunction = YAHOO.widget.FlashAdapter.createProxyFunction(currentSeries.labelFunction);
+ clonedSeries.labelFunction = YAHOO.widget.Chart.createProxyFunction(currentSeries.labelFunction);
this._seriesLabelFunctions.push(clonedSeries.labelFunction);
}
}
@@ -1359,12 +740,12 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
if(this._dataTipFunction)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);
+ YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);
}
if(value && typeof value == "function")
{
- value = YAHOO.widget.FlashAdapter.createProxyFunction(value);
+ value = YAHOO.widget.Chart.createProxyFunction(value);
this._dataTipFunction = value;
}
this._swf.setDataTipFunction(value);
@@ -1391,10 +772,176 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
this._pollingInterval = value;
this.refreshData();
+ },
+
+ /**
+ * The javascript wrapper for the swf object
+ *
+ * @property _swfEmbed
+ * @type swf
+ * @private
+ */
+ _swfEmbed: null,
+
+ /**
+ * The URL of the SWF file.
+ * @property _swfURL
+ * @type String
+ * @private
+ */
+ _swfURL: null,
+
+ /**
+ * The ID of the containing DIV.
+ * @property _containerID
+ * @type String
+ * @private
+ */
+ _containerID: null,
+
+ /**
+ * A reference to the embedded SWF file.
+ * @property _swf
+ * @private
+ */
+ _swf: null,
+
+ /**
+ * The id of this instance.
+ * @property _id
+ * @type String
+ * @private
+ */
+ _id: null,
+
+ /**
+ * Indicates whether the SWF has been initialized and is ready
+ * to communicate with JavaScript
+ * @property _initialized
+ * @type Boolean
+ * @private
+ */
+ _initialized: false,
+
+ /**
+ * The initializing attributes are stored here until the SWF is ready.
+ * @property _attributes
+ * @type Object
+ * @private
+ */
+ _attributes: null, //the intializing attributes
+
+ set: function(name, value)
+ {
+ //save all the attributes in case the swf reloads
+ //so that we can pass them in again
+ this._attributes[name] = value;
+ YAHOO.widget.Chart.superclass.set.call(this, name, value);
+ },
+
+ /**
+ * Getter for swfURL attribute.
+ *
+ * @method _getSWFURL
+ * @private
+ */
+ _getSWFURL: function()
+ {
+ return this._swfURL;
+ },
+
+ /**
+ * Getter for altText attribute.
+ *
+ * @method _getAltText
+ * @private
+ */
+ _getAltText: function()
+ {
+ return this._swf.getAltText();
+ },
+
+ /**
+ * Setter for altText attribute.
+ *
+ * @method _setAltText
+ * @private
+ */
+ _setAltText: function(value)
+ {
+ return this._swf.setAltText(value);
}
});
/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of Chart.
+ *
+ * @method YAHOO.widget.Chart.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.Chart.eventHandler = function(elementID, event)
+{
+ var loadedSWF = YAHOO.util.Dom.get(elementID);
+ if(!loadedSWF.owner)
+ {
+ //fix for ie: if owner doesn't exist yet, try again in a moment
+ setTimeout(function() { YAHOO.widget.Chart.eventHandler( elementID, event ); }, 0);
+ }
+ else
+ {
+ loadedSWF.owner._eventHandler(event);
+ }
+};
+
+/**
+ * The number of proxy functions that have been created.
+ * @static
+ * @private
+ */
+YAHOO.widget.Chart.proxyFunctionCount = 0;
+
+/**
+ * Creates a globally accessible function that wraps a function reference.
+ * Returns the proxy function's name as a string for use by the SWF through
+ * ExternalInterface.
+ *
+ * @method YAHOO.widget.Chart.createProxyFunction
+ * @static
+ * @private
+ */
+YAHOO.widget.Chart.createProxyFunction = function(func)
+{
+ var index = YAHOO.widget.Chart.proxyFunctionCount;
+ YAHOO.widget.Chart["proxyFunction" + index] = function()
+ {
+ return func.apply(null, arguments);
+ };
+ YAHOO.widget.Chart.proxyFunctionCount++;
+ return "YAHOO.widget.Chart.proxyFunction" + index.toString();
+};
+
+/**
+ * Removes a function created with createProxyFunction()
+ *
+ * @method YAHOO.widget.Chart.removeProxyFunction
+ * @static
+ * @private
+ */
+YAHOO.widget.Chart.removeProxyFunction = function(funcName)
+{
+ //quick error check
+ if(!funcName || funcName.indexOf("YAHOO.widget.Chart.proxyFunction") < 0)
+ {
+ return;
+ }
+
+ funcName = funcName.substr(26);
+ YAHOO.widget.Chart[funcName] = null;
+};
+
+/**
* Storage for the dataTipFunction attribute.
*
* @property Chart.SWFURL
@@ -1530,7 +1077,7 @@ YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
{
/**
* Stores a reference to the xAxis labelFunction created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _xAxisLabelFunctions
* @type String
* @private
@@ -1539,7 +1086,7 @@ YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
/**
* Stores a reference to the yAxis labelFunctions created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _yAxisLabelFunctions
* @type Array
* @private
@@ -1701,7 +1248,7 @@ YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
{
if(typeof value.labelFunction == "function")
{
- clonedAxis.labelFunction = YAHOO.widget.FlashAdapter.createProxyFunction(value.labelFunction);
+ clonedAxis.labelFunction = YAHOO.widget.Chart.createProxyFunction(value.labelFunction);
}
else
{
@@ -1732,7 +1279,7 @@ YAHOO.lang.extend(YAHOO.widget.CartesianChart, YAHOO.widget.Chart,
{
if(axisFunctions[i] !== null)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(axisFunctions[i]);
+ YAHOO.widget.Chart.removeProxyFunction(axisFunctions[i]);
}
}
axisFunctions = [];
View
14 build/charts/charts-min.js
@@ -1,11 +1,3 @@
-/*
- * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
- *
- * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
- * @namespace YAHOO
- */
-YAHOO.namespace("deconcept");YAHOO.deconcept=YAHOO.deconcept||{};if(typeof YAHOO.deconcept.util=="undefined"||!YAHOO.deconcept.util){YAHOO.deconcept.util={};}if(typeof YAHOO.deconcept.SWFObjectUtil=="undefined"||!YAHOO.deconcept.SWFObjectUtil){YAHOO.deconcept.SWFObjectUtil={};}YAHOO.deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return;}this.DETECT_KEY=D?D:"detectflash";this.skipDetect=YAHOO.deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(E){this.setAttribute("swf",E);}if(C){this.setAttribute("id",C);}if(K){this.setAttribute("width",K);}if(F){this.setAttribute("height",F);}if(H){this.setAttribute("version",new YAHOO.deconcept.PlayerVersion(H.toString().split(".")));}this.installedVer=YAHOO.deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){YAHOO.deconcept.SWFObject.doPrepUnload=true;}if(J){this.addParam("bgcolor",J);}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A);}};YAHOO.deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true);},setAttribute:function(A,B){this.attributes[A]=B;},getAttribute:function(A){return this.attributes[A];},addParam:function(A,B){this.params[A]=B;},getParams:function(){return this.params;},addVariable:function(A,B){this.variables[A]=B;},getVariable:function(A){return this.variables[A];},getVariables:function(){return this.variables;},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){if(C.hasOwnProperty(B)){A[A.length]=B+"="+C[B];}}return A;},getSWFHTML:function(){var D="";var C={};var A="";var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';C=this.getParams();for(A in C){if(C.hasOwnProperty(A)){D+=[A]+'="'+C[A]+'" ';}}B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"';}D+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';C=this.getParams();for(A in C){if(C.hasOwnProperty(A)){D+='<param name="'+A+'" value="'+C[A]+'" />';}}B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />';}D+="</object>";}return D;},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new YAHOO.deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!==""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};YAHOO.deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=null;var C=new YAHOO.deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new YAHOO.deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new YAHOO.deconcept.PlayerVersion([B,0,0]);}catch(E){D=null;}}}else{try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(E){try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new YAHOO.deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always";}catch(E){if(C.major==6){return C;}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(E){}}if(D!==null){C=new YAHOO.deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","));}}}return C;};YAHOO.deconcept.PlayerVersion=function(A){this.major=A[0]!==null?parseInt(A[0],0):0;this.minor=A[1]!==null?parseInt(A[1],0):0;this.rev=A[2]!==null?parseInt(A[2],0):0;};YAHOO.deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false;}if(this.major>A.major){return true;}if(this.minor<A.minor){return false;}if(this.minor>A.minor){return true;}if(this.rev<A.rev){return false;}return true;};YAHOO.deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D===null){return C;}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1));}}}return"";
-}};YAHOO.deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){};}}}};if(YAHOO.deconcept.SWFObject.doPrepUnload){if(!YAHOO.deconcept.unloadSet){YAHOO.deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",YAHOO.deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",YAHOO.deconcept.SWFObjectUtil.prepUnload);YAHOO.deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A];};}YAHOO.widget.FlashAdapter=function(D,A,B){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};B=B||{};this._id=B.id=B.id||YAHOO.util.Dom.generateId(null,"yuigen");B.version=B.version||"9.0.45";B.backgroundColor=B.backgroundColor||"#ffffff";this._attributes=B;this._swfURL=D;this._containerID=A;this._embedSWF(this._swfURL,this._containerID,B.id,B.version,B.backgroundColor,B.expressInstall,B.wmode);try{this.createEvent("contentReady");}catch(C){}};YAHOO.extend(YAHOO.widget.FlashAdapter,YAHOO.util.AttributeProvider,{_swfURL:null,_containerID:null,_swf:null,_id:null,_initialized:false,_attributes:null,toString:function(){return"FlashAdapter "+this._id;},destroy:function(){if(this._swf){var B=YAHOO.util.Dom.get(this._containerID);B.removeChild(this._swf);}var A=this._id;for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}},_embedSWF:function(I,H,D,C,F,G,B){var E=new YAHOO.deconcept.SWFObject(I,D,"100%","100%",C,F);if(G){E.useExpressInstall(G);}E.addParam("allowScriptAccess","always");if(B){E.addParam("wmode",B);}E.addVariable("allowedDomain",document.location.hostname);E.addVariable("elementID",D);E.addVariable("eventHandler","YAHOO.widget.FlashAdapter.eventHandler");var A=YAHOO.util.Dom.get(H);var J=E.write(A);if(J){this._swf=YAHOO.util.Dom.get(D);this._swf.owner=this;}else{}},_eventHandler:function(B){var A=B.type;switch(A){case"swfReady":this._loadHandler();this.fireEvent("contentReady");return;case"log":return;}this.fireEvent(A,B);},_loadHandler:function(){this._initialized=false;this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._initialized=true;},set:function(A,B){this._attributes[A]=B;YAHOO.widget.FlashAdapter.superclass.set.call(this,A,B);},_initAttributes:function(A){this.getAttributeConfig("altText",{method:this._getAltText});this.setAttributeConfig("altText",{method:this._setAltText});this.getAttributeConfig("swfURL",{method:this._getSWFURL});},_getSWFURL:function(){return this._swfURL;},_getAltText:function(){return this._swf.getAltText();},_setAltText:function(A){return this._swf.setAltText(A);}});YAHOO.widget.FlashAdapter.eventHandler=function(A,C){var B=YAHOO.util.Dom.get(A);if(!B.owner){setTimeout(function(){YAHOO.widget.FlashAdapter.eventHandler(A,C);},0);}else{B.owner._eventHandler(C);}};YAHOO.widget.FlashAdapter.proxyFunctionCount=0;YAHOO.widget.FlashAdapter.createProxyFunction=function(B){var A=YAHOO.widget.FlashAdapter.proxyFunctionCount;YAHOO.widget.FlashAdapter["proxyFunction"+A]=function(){return B.apply(null,arguments);};YAHOO.widget.FlashAdapter.proxyFunctionCount++;return"YAHOO.widget.FlashAdapter.proxyFunction"+A.toString();};YAHOO.widget.FlashAdapter.removeProxyFunction=function(A){if(!A||A.indexOf("YAHOO.widget.FlashAdapter.proxyFunction")<0){return;}A=A.substr(26);YAHOO.widget.FlashAdapter[A]=null;};YAHOO.widget.Chart=function(C,A,D,B){YAHOO.widget.Chart.superclass.constructor.call(this,YAHOO.widget.Chart.SWFURL,A,B);this._type=C;this._dataSource=D;this.createEvent("itemMouseOverEvent");this.createEvent("itemMouseOutEvent");this.createEvent("itemClickEvent");this.createEvent("itemDoubleClickEvent");this.createEvent("itemDragStartEvent");this.createEvent("itemDragEvent");this.createEvent("itemDragEndEvent");};YAHOO.extend(YAHOO.widget.Chart,YAHOO.widget.FlashAdapter,{_type:null,_pollingID:null,_pollingInterval:null,_dataTipFunction:null,_seriesLabelFunctions:null,toString:function(){return"Chart "+this._id;},setStyle:function(A,B){B=YAHOO.lang.JSON.stringify(B);this._swf.setStyle(A,B);},setStyles:function(A){A=YAHOO.lang.JSON.stringify(A);this._swf.setStyles(A);},setSeriesStyles:function(B){for(var A=0;A<B.length;A++){B[A]=YAHOO.lang.JSON.stringify(B[A]);}this._swf.setSeriesStyles(B);},destroy:function(){if(this._dataSource!==null){if(this._pollingID!==null){this._dataSource.clearInterval(this._pollingID);this._pollingID=null;}}if(this._dataTipFunction){YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);}YAHOO.widget.Chart.superclass.destroy.call(this);},_initAttributes:function(A){YAHOO.widget.Chart.superclass._initAttributes.call(this,A);this.getAttributeConfig("request",{method:this._getRequest});this.setAttributeConfig("request",{method:this._setRequest});this.getAttributeConfig("dataSource",{method:this._getDataSource});this.setAttributeConfig("dataSource",{method:this._setDataSource});this.getAttributeConfig("series",{method:this._getSeriesDefs});this.setAttributeConfig("series",{method:this._setSeriesDefs});this.getAttributeConfig("categoryNames",{method:this._getCategoryNames});this.setAttributeConfig("categoryNames",{validator:YAHOO.lang.isArray,method:this._setCategoryNames});this.getAttributeConfig("dataTipFunction",{method:this._getDataTipFunction});this.setAttributeConfig("dataTipFunction",{method:this._setDataTipFunction});this.getAttributeConfig("polling",{method:this._getPolling});this.setAttributeConfig("polling",{method:this._setPolling});},_loadHandler:function(){this._swf.setType(this._type);if(this._attributes.style){var A=this._attributes.style;this.setStyles(A);}YAHOO.widget.Chart.superclass._loadHandler.call(this);if(this._dataSource){this.set("dataSource",this._dataSource);}},refreshData:function(){if(!this._initialized){return;
-}if(this._dataSource!==null){if(this._pollingID!==null){this._dataSource.clearInterval(this._pollingID);this._pollingID=null;}if(this._pollingInterval>0){this._pollingID=this._dataSource.setInterval(this._pollingInterval,this._request,this._loadDataHandler,this);}this._dataSource.sendRequest(this._request,this._loadDataHandler,this);}},_loadDataHandler:function(D,C,J){if(this._swf){if(J){}else{var H;if(this._seriesLabelFunctions){var I=this._seriesLabelFunctions.length;for(H=0;H<I;H++){YAHOO.widget.FlashAdapter.removeProxyFunction(this._seriesLabelFunctions[H]);}this._seriesLabelFunction=null;}this._seriesLabelFunctions=[];var F=[];var E=0;var K=null;if(this._seriesDefs!==null){E=this._seriesDefs.length;for(H=0;H<E;H++){K=this._seriesDefs[H];var B={};for(var A in K){if(YAHOO.lang.hasOwnProperty(K,A)){if(A=="style"){if(K.style!==null){B.style=YAHOO.lang.JSON.stringify(K.style);}}else{if(A=="labelFunction"){if(K.labelFunction!==null&&typeof K.labelFunction=="function"){B.labelFunction=YAHOO.widget.FlashAdapter.createProxyFunction(K.labelFunction);this._seriesLabelFunctions.push(B.labelFunction);}}else{B[A]=K[A];}}}}F.push(B);}}if(E>0){for(H=0;H<E;H++){K=F[H];if(!K.type){K.type=this._type;}K.dataProvider=C.results;}}else{var G={type:this._type,dataProvider:C.results};F.push(G);}this._swf.setDataProvider(F);}}},_request:"",_getRequest:function(){return this._request;},_setRequest:function(A){this._request=A;this.refreshData();},_dataSource:null,_getDataSource:function(){return this._dataSource;},_setDataSource:function(A){this._dataSource=A;this.refreshData();},_seriesDefs:null,_getSeriesDefs:function(){return this._seriesDefs;},_setSeriesDefs:function(A){this._seriesDefs=A;this.refreshData();},_getCategoryNames:function(){this._swf.getCategoryNames();},_setCategoryNames:function(A){this._swf.setCategoryNames(A);},_setDataTipFunction:function(A){if(this._dataTipFunction){YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);}if(A&&typeof A=="function"){A=YAHOO.widget.FlashAdapter.createProxyFunction(A);this._dataTipFunction=A;}this._swf.setDataTipFunction(A);},_getPolling:function(){return this._pollingInterval;},_setPolling:function(A){this._pollingInterval=A;this.refreshData();}});YAHOO.widget.Chart.SWFURL="assets/charts.swf";YAHOO.widget.PieChart=function(A,C,B){YAHOO.widget.PieChart.superclass.constructor.call(this,"pie",A,C,B);};YAHOO.lang.extend(YAHOO.widget.PieChart,YAHOO.widget.Chart,{_initAttributes:function(A){YAHOO.widget.PieChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("dataField",{method:this._getDataField});this.setAttributeConfig("dataField",{validator:YAHOO.lang.isString,method:this._setDataField});this.getAttributeConfig("categoryField",{method:this._getCategoryField});this.setAttributeConfig("categoryField",{validator:YAHOO.lang.isString,method:this._setCategoryField});},_getDataField:function(){return this._swf.getDataField();},_setDataField:function(A){this._swf.setDataField(A);},_getCategoryField:function(){return this._swf.getCategoryField();},_setCategoryField:function(A){this._swf.setCategoryField(A);}});YAHOO.widget.CartesianChart=function(C,A,D,B){YAHOO.widget.CartesianChart.superclass.constructor.call(this,C,A,D,B);};YAHOO.lang.extend(YAHOO.widget.CartesianChart,YAHOO.widget.Chart,{_xAxisLabelFunctions:[],_yAxisLabelFunctions:[],destroy:function(){this._removeAxisFunctions(this._xAxisLabelFunctions);this._removeAxisFunctions(this._yAxisLabelFunctions);YAHOO.widget.CartesianChart.superclass.destroy.call(this);},_initAttributes:function(A){YAHOO.widget.CartesianChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("xField",{method:this._getXField});this.setAttributeConfig("xField",{validator:YAHOO.lang.isString,method:this._setXField});this.getAttributeConfig("yField",{method:this._getYField});this.setAttributeConfig("yField",{validator:YAHOO.lang.isString,method:this._setYField});this.setAttributeConfig("xAxis",{method:this._setXAxis});this.setAttributeConfig("xAxes",{method:this._setXAxes});this.setAttributeConfig("yAxis",{method:this._setYAxis});this.setAttributeConfig("yAxes",{method:this._setYAxes});},_getXField:function(){return this._swf.getHorizontalField();},_setXField:function(A){this._swf.setHorizontalField(A);},_getYField:function(){return this._swf.getVerticalField();},_setYField:function(A){this._swf.setVerticalField(A);},_getClonedAxis:function(A){var B={};for(var C in A){if(C=="labelFunction"){if(A.labelFunction!==null){if(typeof A.labelFunction=="function"){B.labelFunction=YAHOO.widget.FlashAdapter.createProxyFunction(A.labelFunction);}else{B.labelFunction=A.labelFunction;}}}else{B[C]=A[C];}}return B;},_removeAxisFunctions:function(C){if(C&&C.length>0){var A=C.length;for(var B=0;B<A;B++){if(C[B]!==null){YAHOO.widget.FlashAdapter.removeProxyFunction(C[B]);}}C=[];}},_setXAxis:function(A){if(A.position!="bottom"&&A.position!="top"){A.position="bottom";}this._removeAxisFunctions(this._xAxisLabelFunctions);A=this._getClonedAxis(A);this._xAxisLabelFunctions.push(A.labelFunction);this._swf.setHorizontalAxis(A);},_setXAxes:function(C){this._removeAxisFunctions(this._xAxisLabelFunctions);var A=C.length;for(var B=0;B<A;B++){if(C[B].position=="left"){C[B].position="bottom";}C[B]=this._getClonedAxis(C[B]);if(C[B].labelFunction){this._xAxisLabelFunctions.push(C[B].labelFunction);}this._swf.setHorizontalAxis(C[B]);}},_setYAxis:function(A){this._removeAxisFunctions(this._yAxisLabelFunctions);A=this._getClonedAxis(A);this._yAxisLabelFunctions.push(A.labelFunction);this._swf.setVerticalAxis(A);},_setYAxes:function(C){this._removeAxisFunctions(this._yAxisLabelFunctions);var A=C.length;for(var B=0;B<A;B++){C[B]=this._getClonedAxis(C[B]);if(C[B].labelFunction){this._yAxisLabelFunctions.push(C[B].labelFunction);}this._swf.setVerticalAxis(C[B]);}}});YAHOO.widget.LineChart=function(A,C,B){YAHOO.widget.LineChart.superclass.constructor.call(this,"line",A,C,B);};YAHOO.lang.extend(YAHOO.widget.LineChart,YAHOO.widget.CartesianChart);
-YAHOO.widget.ColumnChart=function(A,C,B){YAHOO.widget.ColumnChart.superclass.constructor.call(this,"column",A,C,B);};YAHOO.lang.extend(YAHOO.widget.ColumnChart,YAHOO.widget.CartesianChart);YAHOO.widget.BarChart=function(A,C,B){YAHOO.widget.BarChart.superclass.constructor.call(this,"bar",A,C,B);};YAHOO.lang.extend(YAHOO.widget.BarChart,YAHOO.widget.CartesianChart);YAHOO.widget.StackedColumnChart=function(A,C,B){YAHOO.widget.StackedColumnChart.superclass.constructor.call(this,"stackcolumn",A,C,B);};YAHOO.lang.extend(YAHOO.widget.StackedColumnChart,YAHOO.widget.CartesianChart);YAHOO.widget.StackedBarChart=function(A,C,B){YAHOO.widget.StackedBarChart.superclass.constructor.call(this,"stackbar",A,C,B);};YAHOO.lang.extend(YAHOO.widget.StackedBarChart,YAHOO.widget.CartesianChart);YAHOO.widget.Axis=function(){};YAHOO.widget.Axis.prototype={type:null,reverse:false,labelFunction:null,labelSpacing:2,title:null};YAHOO.widget.NumericAxis=function(){YAHOO.widget.NumericAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.NumericAxis,YAHOO.widget.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,stackingEnabled:false,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left"});YAHOO.widget.TimeAxis=function(){YAHOO.widget.TimeAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.TimeAxis,YAHOO.widget.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});YAHOO.widget.CategoryAxis=function(){YAHOO.widget.CategoryAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.CategoryAxis,YAHOO.widget.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});YAHOO.widget.Series=function(){};YAHOO.widget.Series.prototype={type:null,displayName:null};YAHOO.widget.CartesianSeries=function(){YAHOO.widget.CartesianSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.CartesianSeries,YAHOO.widget.Series,{xField:null,yField:null,axis:"primary"});YAHOO.widget.ColumnSeries=function(){YAHOO.widget.ColumnSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.ColumnSeries,YAHOO.widget.CartesianSeries,{type:"column"});YAHOO.widget.LineSeries=function(){YAHOO.widget.LineSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.LineSeries,YAHOO.widget.CartesianSeries,{type:"line"});YAHOO.widget.BarSeries=function(){YAHOO.widget.BarSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.BarSeries,YAHOO.widget.CartesianSeries,{type:"bar"});YAHOO.widget.PieSeries=function(){YAHOO.widget.PieSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.PieSeries,YAHOO.widget.Series,{type:"pie",dataField:null,categoryField:null,labelFunction:null});YAHOO.widget.StackedBarSeries=function(){YAHOO.widget.StackedBarSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.StackedBarSeries,YAHOO.widget.CartesianSeries,{type:"stackbar"});YAHOO.widget.StackedColumnSeries=function(){YAHOO.widget.StackedColumnSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.StackedColumnSeries,YAHOO.widget.CartesianSeries,{type:"stackcolumn"});YAHOO.register("charts",YAHOO.widget.Chart,{version:"@VERSION@",build:"@BUILD@"});
+YAHOO.widget.Chart=function(C,A,E,B){this._attributes=B;this._swfEmbed=new YAHOO.widget.SWF(A,YAHOO.widget.Chart.SWFURL,B);this._swf=this._swfEmbed.swf;this._swfEmbed.addListener("swfReady",this._eventHandler,null,this);this._type=C;this._dataSource=E;try{this.createEvent("contentReady");}catch(D){}this.createEvent("itemMouseOverEvent");this.createEvent("itemMouseOutEvent");this.createEvent("itemClickEvent");this.createEvent("itemDoubleClickEvent");this.createEvent("itemDragStartEvent");this.createEvent("itemDragEvent");this.createEvent("itemDragEndEvent");};YAHOO.extend(YAHOO.widget.Chart,YAHOO.util.AttributeProvider,{_type:null,_pollingID:null,_pollingInterval:null,_dataTipFunction:null,_seriesLabelFunctions:null,toString:function(){return"Chart "+this._id;},setStyle:function(A,B){B=YAHOO.lang.JSON.stringify(B);this._swf.setStyle(A,B);},setStyles:function(A){A=YAHOO.lang.JSON.stringify(A);this._swf.setStyles(A);},setSeriesStyles:function(B){for(var A=0;A<B.length;A++){B[A]=YAHOO.lang.JSON.stringify(B[A]);}this._swf.setSeriesStyles(B);},destroy:function(){if(this._dataSource!==null){if(this._pollingID!==null){this._dataSource.clearInterval(this._pollingID);this._pollingID=null;}}if(this._dataTipFunction){YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);}if(this._swf){var B=YAHOO.util.Dom.get(this._containerID);B.removeChild(this._swf);}var A=this._id;for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}},_initAttributes:function(A){this.getAttributeConfig("altText",{method:this._getAltText});this.setAttributeConfig("altText",{method:this._setAltText});this.getAttributeConfig("swfURL",{method:this._getSWFURL});this.getAttributeConfig("request",{method:this._getRequest});this.setAttributeConfig("request",{method:this._setRequest});this.getAttributeConfig("dataSource",{method:this._getDataSource});this.setAttributeConfig("dataSource",{method:this._setDataSource});this.getAttributeConfig("series",{method:this._getSeriesDefs});this.setAttributeConfig("series",{method:this._setSeriesDefs});this.getAttributeConfig("categoryNames",{method:this._getCategoryNames});this.setAttributeConfig("categoryNames",{validator:YAHOO.lang.isArray,method:this._setCategoryNames});this.getAttributeConfig("dataTipFunction",{method:this._getDataTipFunction});this.setAttributeConfig("dataTipFunction",{method:this._setDataTipFunction});this.getAttributeConfig("polling",{method:this._getPolling});this.setAttributeConfig("polling",{method:this._setPolling});},_eventHandler:function(B){var A=B.type;switch(A){case"swfReady":this._swf=this._swfEmbed._swf;this._loadHandler();this.fireEvent("contentReady");return;case"log":this.fireEvent(A,B);return;}},_loadHandler:function(){this._swf.setType(this._type);if(this._attributes.style){var A=this._attributes.style;this.setStyles(A);}this._initialized=false;this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._initialized=true;if(this._dataSource){this.set("dataSource",this._dataSource);}},refreshData:function(){if(!this._initialized){return;}if(this._dataSource!==null){if(this._pollingID!==null){this._dataSource.clearInterval(this._pollingID);this._pollingID=null;}if(this._pollingInterval>0){this._pollingID=this._dataSource.setInterval(this._pollingInterval,this._request,this._loadDataHandler,this);}this._dataSource.sendRequest(this._request,this._loadDataHandler,this);}},_loadDataHandler:function(D,C,J){if(this._swf){if(J){}else{var H;if(this._seriesLabelFunctions){var I=this._seriesLabelFunctions.length;for(H=0;H<I;H++){YAHOO.widget.Chart.removeProxyFunction(this._seriesLabelFunctions[H]);}this._seriesLabelFunction=null;}this._seriesLabelFunctions=[];var F=[];var E=0;var K=null;if(this._seriesDefs!==null){E=this._seriesDefs.length;for(H=0;H<E;H++){K=this._seriesDefs[H];var B={};for(var A in K){if(YAHOO.lang.hasOwnProperty(K,A)){if(A=="style"){if(K.style!==null){B.style=YAHOO.lang.JSON.stringify(K.style);}}else{if(A=="labelFunction"){if(K.labelFunction!==null&&typeof K.labelFunction=="function"){B.labelFunction=YAHOO.widget.Chart.createProxyFunction(K.labelFunction);this._seriesLabelFunctions.push(B.labelFunction);}}else{B[A]=K[A];}}}}F.push(B);}}if(E>0){for(H=0;H<E;H++){K=F[H];if(!K.type){K.type=this._type;}K.dataProvider=C.results;}}else{var G={type:this._type,dataProvider:C.results};F.push(G);}this._swf.setDataProvider(F);}}},_request:"",_getRequest:function(){return this._request;},_setRequest:function(A){this._request=A;this.refreshData();},_dataSource:null,_getDataSource:function(){return this._dataSource;},_setDataSource:function(A){this._dataSource=A;this.refreshData();},_seriesDefs:null,_getSeriesDefs:function(){return this._seriesDefs;},_setSeriesDefs:function(A){this._seriesDefs=A;this.refreshData();},_getCategoryNames:function(){this._swf.getCategoryNames();},_setCategoryNames:function(A){this._swf.setCategoryNames(A);},_setDataTipFunction:function(A){if(this._dataTipFunction){YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);}if(A&&typeof A=="function"){A=YAHOO.widget.Chart.createProxyFunction(A);this._dataTipFunction=A;}this._swf.setDataTipFunction(A);},_getPolling:function(){return this._pollingInterval;},_setPolling:function(A){this._pollingInterval=A;this.refreshData();},_swfEmbed:null,_swfURL:null,_containerID:null,_swf:null,_id:null,_initialized:false,_attributes:null,set:function(A,B){this._attributes[A]=B;YAHOO.widget.Chart.superclass.set.call(this,A,B);},_getSWFURL:function(){return this._swfURL;},_getAltText:function(){return this._swf.getAltText();},_setAltText:function(A){return this._swf.setAltText(A);}});YAHOO.widget.Chart.eventHandler=function(A,C){var B=YAHOO.util.Dom.get(A);if(!B.owner){setTimeout(function(){YAHOO.widget.Chart.eventHandler(A,C);},0);}else{B.owner._eventHandler(C);}};YAHOO.widget.Chart.proxyFunctionCount=0;YAHOO.widget.Chart.createProxyFunction=function(B){var A=YAHOO.widget.Chart.proxyFunctionCount;YAHOO.widget.Chart["proxyFunction"+A]=function(){return B.apply(null,arguments);
+};YAHOO.widget.Chart.proxyFunctionCount++;return"YAHOO.widget.Chart.proxyFunction"+A.toString();};YAHOO.widget.Chart.removeProxyFunction=function(A){if(!A||A.indexOf("YAHOO.widget.Chart.proxyFunction")<0){return;}A=A.substr(26);YAHOO.widget.Chart[A]=null;};YAHOO.widget.Chart.SWFURL="assets/charts.swf";YAHOO.widget.PieChart=function(A,C,B){YAHOO.widget.PieChart.superclass.constructor.call(this,"pie",A,C,B);};YAHOO.lang.extend(YAHOO.widget.PieChart,YAHOO.widget.Chart,{_initAttributes:function(A){YAHOO.widget.PieChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("dataField",{method:this._getDataField});this.setAttributeConfig("dataField",{validator:YAHOO.lang.isString,method:this._setDataField});this.getAttributeConfig("categoryField",{method:this._getCategoryField});this.setAttributeConfig("categoryField",{validator:YAHOO.lang.isString,method:this._setCategoryField});},_getDataField:function(){return this._swf.getDataField();},_setDataField:function(A){this._swf.setDataField(A);},_getCategoryField:function(){return this._swf.getCategoryField();},_setCategoryField:function(A){this._swf.setCategoryField(A);}});YAHOO.widget.CartesianChart=function(C,A,D,B){YAHOO.widget.CartesianChart.superclass.constructor.call(this,C,A,D,B);};YAHOO.lang.extend(YAHOO.widget.CartesianChart,YAHOO.widget.Chart,{_xAxisLabelFunctions:[],_yAxisLabelFunctions:[],destroy:function(){this._removeAxisFunctions(this._xAxisLabelFunctions);this._removeAxisFunctions(this._yAxisLabelFunctions);YAHOO.widget.CartesianChart.superclass.destroy.call(this);},_initAttributes:function(A){YAHOO.widget.CartesianChart.superclass._initAttributes.call(this,A);this.getAttributeConfig("xField",{method:this._getXField});this.setAttributeConfig("xField",{validator:YAHOO.lang.isString,method:this._setXField});this.getAttributeConfig("yField",{method:this._getYField});this.setAttributeConfig("yField",{validator:YAHOO.lang.isString,method:this._setYField});this.setAttributeConfig("xAxis",{method:this._setXAxis});this.setAttributeConfig("xAxes",{method:this._setXAxes});this.setAttributeConfig("yAxis",{method:this._setYAxis});this.setAttributeConfig("yAxes",{method:this._setYAxes});},_getXField:function(){return this._swf.getHorizontalField();},_setXField:function(A){this._swf.setHorizontalField(A);},_getYField:function(){return this._swf.getVerticalField();},_setYField:function(A){this._swf.setVerticalField(A);},_getClonedAxis:function(A){var B={};for(var C in A){if(C=="labelFunction"){if(A.labelFunction!==null){if(typeof A.labelFunction=="function"){B.labelFunction=YAHOO.widget.Chart.createProxyFunction(A.labelFunction);}else{B.labelFunction=A.labelFunction;}}}else{B[C]=A[C];}}return B;},_removeAxisFunctions:function(C){if(C&&C.length>0){var A=C.length;for(var B=0;B<A;B++){if(C[B]!==null){YAHOO.widget.Chart.removeProxyFunction(C[B]);}}C=[];}},_setXAxis:function(A){if(A.position!="bottom"&&A.position!="top"){A.position="bottom";}this._removeAxisFunctions(this._xAxisLabelFunctions);A=this._getClonedAxis(A);this._xAxisLabelFunctions.push(A.labelFunction);this._swf.setHorizontalAxis(A);},_setXAxes:function(C){this._removeAxisFunctions(this._xAxisLabelFunctions);var A=C.length;for(var B=0;B<A;B++){if(C[B].position=="left"){C[B].position="bottom";}C[B]=this._getClonedAxis(C[B]);if(C[B].labelFunction){this._xAxisLabelFunctions.push(C[B].labelFunction);}this._swf.setHorizontalAxis(C[B]);}},_setYAxis:function(A){this._removeAxisFunctions(this._yAxisLabelFunctions);A=this._getClonedAxis(A);this._yAxisLabelFunctions.push(A.labelFunction);this._swf.setVerticalAxis(A);},_setYAxes:function(C){this._removeAxisFunctions(this._yAxisLabelFunctions);var A=C.length;for(var B=0;B<A;B++){C[B]=this._getClonedAxis(C[B]);if(C[B].labelFunction){this._yAxisLabelFunctions.push(C[B].labelFunction);}this._swf.setVerticalAxis(C[B]);}}});YAHOO.widget.LineChart=function(A,C,B){YAHOO.widget.LineChart.superclass.constructor.call(this,"line",A,C,B);};YAHOO.lang.extend(YAHOO.widget.LineChart,YAHOO.widget.CartesianChart);YAHOO.widget.ColumnChart=function(A,C,B){YAHOO.widget.ColumnChart.superclass.constructor.call(this,"column",A,C,B);};YAHOO.lang.extend(YAHOO.widget.ColumnChart,YAHOO.widget.CartesianChart);YAHOO.widget.BarChart=function(A,C,B){YAHOO.widget.BarChart.superclass.constructor.call(this,"bar",A,C,B);};YAHOO.lang.extend(YAHOO.widget.BarChart,YAHOO.widget.CartesianChart);YAHOO.widget.StackedColumnChart=function(A,C,B){YAHOO.widget.StackedColumnChart.superclass.constructor.call(this,"stackcolumn",A,C,B);};YAHOO.lang.extend(YAHOO.widget.StackedColumnChart,YAHOO.widget.CartesianChart);YAHOO.widget.StackedBarChart=function(A,C,B){YAHOO.widget.StackedBarChart.superclass.constructor.call(this,"stackbar",A,C,B);};YAHOO.lang.extend(YAHOO.widget.StackedBarChart,YAHOO.widget.CartesianChart);YAHOO.widget.Axis=function(){};YAHOO.widget.Axis.prototype={type:null,reverse:false,labelFunction:null,labelSpacing:2,title:null};YAHOO.widget.NumericAxis=function(){YAHOO.widget.NumericAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.NumericAxis,YAHOO.widget.Axis,{type:"numeric",minimum:NaN,maximum:NaN,majorUnit:NaN,minorUnit:NaN,snapToUnits:true,stackingEnabled:false,alwaysShowZero:true,scale:"linear",roundMajorUnit:true,calculateByLabelSize:true,position:"left"});YAHOO.widget.TimeAxis=function(){YAHOO.widget.TimeAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.TimeAxis,YAHOO.widget.Axis,{type:"time",minimum:null,maximum:null,majorUnit:NaN,majorTimeUnit:null,minorUnit:NaN,minorTimeUnit:null,snapToUnits:true,stackingEnabled:false,calculateByLabelSize:true});YAHOO.widget.CategoryAxis=function(){YAHOO.widget.CategoryAxis.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.CategoryAxis,YAHOO.widget.Axis,{type:"category",categoryNames:null,calculateCategoryCount:false});YAHOO.widget.Series=function(){};YAHOO.widget.Series.prototype={type:null,displayName:null};YAHOO.widget.CartesianSeries=function(){YAHOO.widget.CartesianSeries.superclass.constructor.call(this);
+};YAHOO.lang.extend(YAHOO.widget.CartesianSeries,YAHOO.widget.Series,{xField:null,yField:null,axis:"primary"});YAHOO.widget.ColumnSeries=function(){YAHOO.widget.ColumnSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.ColumnSeries,YAHOO.widget.CartesianSeries,{type:"column"});YAHOO.widget.LineSeries=function(){YAHOO.widget.LineSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.LineSeries,YAHOO.widget.CartesianSeries,{type:"line"});YAHOO.widget.BarSeries=function(){YAHOO.widget.BarSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.BarSeries,YAHOO.widget.CartesianSeries,{type:"bar"});YAHOO.widget.PieSeries=function(){YAHOO.widget.PieSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.PieSeries,YAHOO.widget.Series,{type:"pie",dataField:null,categoryField:null,labelFunction:null});YAHOO.widget.StackedBarSeries=function(){YAHOO.widget.StackedBarSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.StackedBarSeries,YAHOO.widget.CartesianSeries,{type:"stackbar"});YAHOO.widget.StackedColumnSeries=function(){YAHOO.widget.StackedColumnSeries.superclass.constructor.call(this);};YAHOO.lang.extend(YAHOO.widget.StackedColumnSeries,YAHOO.widget.CartesianSeries,{type:"stackcolumn"});YAHOO.register("charts",YAHOO.widget.Chart,{version:"@VERSION@",build:"@BUILD@"});
View
1,055 build/charts/charts.js
@@ -1,734 +1,3 @@
-/*extern ActiveXObject, __flash_unloadHandler, __flash_savedUnloadHandler */
-/*!
- * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
- *
- * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
- * @namespace YAHOO
- */
-
-YAHOO.namespace("deconcept");
-
-YAHOO.deconcept = YAHOO.deconcept || {};
-
-if(typeof YAHOO.deconcept.util == "undefined" || !YAHOO.deconcept.util)
-{
- YAHOO.deconcept.util = {};
-}
-
-if(typeof YAHOO.deconcept.SWFObjectUtil == "undefined" || !YAHOO.deconcept.SWFObjectUtil)
-{
- YAHOO.deconcept.SWFObjectUtil = {};
-}
-
-YAHOO.deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey)
-{
- if(!document.getElementById) { return; }
- this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
- this.skipDetect = YAHOO.deconcept.util.getRequestParameter(this.DETECT_KEY);
- this.params = {};
- this.variables = {};
- this.attributes = [];
- if(swf) { this.setAttribute('swf', swf); }
- if(id) { this.setAttribute('id', id); }
- if(w) { this.setAttribute('width', w); }
- if(h) { this.setAttribute('height', h); }
- if(ver) { this.setAttribute('version', new YAHOO.deconcept.PlayerVersion(ver.toString().split("."))); }
- this.installedVer = YAHOO.deconcept.SWFObjectUtil.getPlayerVersion();
- if (!window.opera && document.all && this.installedVer.major > 7)
- {
- // only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
- YAHOO.deconcept.SWFObject.doPrepUnload = true;
- }
- if(c)
- {
- this.addParam('bgcolor', c);
- }
- var q = quality ? quality : 'high';
- this.addParam('quality', q);
- this.setAttribute('useExpressInstall', false);
- this.setAttribute('doExpressInstall', false);
- var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
- this.setAttribute('xiRedirectUrl', xir);
- this.setAttribute('redirectUrl', '');
- if(redirectUrl)
- {
- this.setAttribute('redirectUrl', redirectUrl);
- }
-};
-
-YAHOO.deconcept.SWFObject.prototype =
-{
- useExpressInstall: function(path)
- {
- this.xiSWFPath = !path ? "expressinstall.swf" : path;
- this.setAttribute('useExpressInstall', true);
- },
- setAttribute: function(name, value){
- this.attributes[name] = value;
- },
- getAttribute: function(name){
- return this.attributes[name];
- },
- addParam: function(name, value){
- this.params[name] = value;
- },
- getParams: function(){
- return this.params;
- },
- addVariable: function(name, value){
- this.variables[name] = value;
- },
- getVariable: function(name){
- return this.variables[name];
- },
- getVariables: function(){
- return this.variables;
- },
- getVariablePairs: function(){
- var variablePairs = [];
- var key;
- var variables = this.getVariables();
- for(key in variables)
- {
- if(variables.hasOwnProperty(key))
- {
- variablePairs[variablePairs.length] = key +"="+ variables[key];
- }
- }
- return variablePairs;
- },
- getSWFHTML: function() {
- var swfNode = "";
- var params = {};
- var key = "";
- var pairs = "";
- if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
- if (this.getAttribute("doExpressInstall")) {
- this.addVariable("MMplayerType", "PlugIn");
- this.setAttribute('swf', this.xiSWFPath);
- }
- swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
- swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
- params = this.getParams();
- for(key in params)
- {
- if(params.hasOwnProperty(key))
- {
- swfNode += [key] +'="'+ params[key] +'" ';
- }
- }
- pairs = this.getVariablePairs().join("&");
- if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
- swfNode += '/>';
- } else { // PC IE
- if (this.getAttribute("doExpressInstall")) {
- this.addVariable("MMplayerType", "ActiveX");
- this.setAttribute('swf', this.xiSWFPath);
- }
- swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
- swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
- params = this.getParams();
- for(key in params)
- {
- if(params.hasOwnProperty(key))
- {
- swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
- }
- }
- pairs = this.getVariablePairs().join("&");
- if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
- swfNode += "</object>";
- }
- return swfNode;
- },
- write: function(elementId)
- {
- if(this.getAttribute('useExpressInstall')) {
- // check to see if we need to do an express install
- var expressInstallReqVer = new YAHOO.deconcept.PlayerVersion([6,0,65]);
- if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
- this.setAttribute('doExpressInstall', true);
- this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
- document.title = document.title.slice(0, 47) + " - Flash Player Installation";
- this.addVariable("MMdoctitle", document.title);
- }
- }
- if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version')))
- {
- var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
- n.innerHTML = this.getSWFHTML();
- return true;
- }
- else
- {
- if(this.getAttribute('redirectUrl') !== "")
- {
- document.location.replace(this.getAttribute('redirectUrl'));
- }
- }
- return false;
- }
-};
-
-/* ---- detection functions ---- */
-YAHOO.deconcept.SWFObjectUtil.getPlayerVersion = function()
-{
- var axo = null;
- var PlayerVersion = new YAHOO.deconcept.PlayerVersion([0,0,0]);
- if(navigator.plugins && navigator.mimeTypes.length)
- {
- var x = navigator.plugins["Shockwave Flash"];
- if(x && x.description)
- {
- PlayerVersion = new YAHOO.deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
- }
- }
- else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0)
- { // if Windows CE
- var counter = 3;
- while(axo)
- {
- try
- {
- counter++;
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
-// document.write("player v: "+ counter);
- PlayerVersion = new YAHOO.deconcept.PlayerVersion([counter,0,0]);
- }
- catch(e)
- {
- axo = null;
- }
- }
- }
- else
- { // Win IE (non mobile)
- // do minor version lookup in IE, but avoid fp6 crashing issues
- // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
- }
- catch(e)
- {
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
- PlayerVersion = new YAHOO.deconcept.PlayerVersion([6,0,21]);
- axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
- }
- catch(e)
- {
- if(PlayerVersion.major == 6)
- {
- return PlayerVersion;
- }
- }
- try
- {
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
- }
- catch(e) {}
- }
-
- if(axo !== null)
- {
- PlayerVersion = new YAHOO.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
- }
- }
- return PlayerVersion;
-};
-
-YAHOO.deconcept.PlayerVersion = function(arrVersion)
-{
- this.major = arrVersion[0] !== null ? parseInt(arrVersion[0], 0) : 0;
- this.minor = arrVersion[1] !== null ? parseInt(arrVersion[1], 0) : 0;
- this.rev = arrVersion[2] !== null ? parseInt(arrVersion[2], 0) : 0;
-};
-
-YAHOO.deconcept.PlayerVersion.prototype.versionIsValid = function(fv)
-{
- if(this.major < fv.major)
- {
- return false;
- }
- if(this.major > fv.major)
- {
- return true;
- }
- if(this.minor < fv.minor)
- {
- return false;
- }
- if(this.minor > fv.minor)
- {
- return true;
- }
- if(this.rev < fv.rev)
- {
- return false;
- }
- return true;
-};
-
-/* ---- get value of query string param ---- */
-YAHOO.deconcept.util =
-{
- getRequestParameter: function(param)
- {
- var q = document.location.search || document.location.hash;
- if(param === null) { return q; }
- if(q)
- {
- var pairs = q.substring(1).split("&");
- for(var i=0; i < pairs.length; i++)
- {
- if (pairs[i].substring(0, pairs[i].indexOf("=")) == param)
- {
- return pairs[i].substring((pairs[i].indexOf("=") + 1));
- }
- }
- }
- return "";
- }
-};
-
-/* fix for video streaming bug */
-YAHOO.deconcept.SWFObjectUtil.cleanupSWFs = function()
-{
- var objects = document.getElementsByTagName("OBJECT");
- for(var i = objects.length - 1; i >= 0; i--)
- {
- objects[i].style.display = 'none';
- for(var x in objects[i])
- {
- if(typeof objects[i][x] == 'function')
- {
- objects[i][x] = function(){};
- }
- }
- }
-};
-
-// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
-if(YAHOO.deconcept.SWFObject.doPrepUnload)
-{
- if(!YAHOO.deconcept.unloadSet)
- {
- YAHOO.deconcept.SWFObjectUtil.prepUnload = function()
- {
- __flash_unloadHandler = function(){};
- __flash_savedUnloadHandler = function(){};
- window.attachEvent("onunload", YAHOO.deconcept.SWFObjectUtil.cleanupSWFs);
- };
- window.attachEvent("onbeforeunload", YAHOO.deconcept.SWFObjectUtil.prepUnload);
- YAHOO.deconcept.unloadSet = true;
- }
-}
-
-/* add document.getElementById if needed (mobile IE < 5) */
-if(!document.getElementById && document.all)
-{
- document.getElementById = function(id) { return document.all[id]; };
-}
-
-/**
- * Wraps Flash embedding functionality and allows communication with SWF through
- * attributes.
- *
- * @namespace YAHOO.widget
- * @class FlashAdapter
- * @uses YAHOO.util.AttributeProvider
- */
-YAHOO.widget.FlashAdapter = function(swfURL, containerID, attributes)
-{
- // set up the initial events and attributes stuff
- this._queue = this._queue || [];
- this._events = this._events || {};
- this._configs = this._configs || {};
- attributes = attributes || {};
-
- //the Flash Player external interface code from Adobe doesn't play nicely
- //with the default value, yui-gen, in IE
- this._id = attributes.id = attributes.id || YAHOO.util.Dom.generateId(null, "yuigen");
- attributes.version = attributes.version || "9.0.45";
- attributes.backgroundColor = attributes.backgroundColor || "#ffffff";
-
- //we can't use the initial attributes right away
- //so save them for once the SWF finishes loading
- this._attributes = attributes;
-
- this._swfURL = swfURL;
- this._containerID = containerID;
-
- //embed the SWF file in the page
- this._embedSWF(this._swfURL, this._containerID, attributes.id, attributes.version,
- attributes.backgroundColor, attributes.expressInstall, attributes.wmode);
-
- /**
- * Fires when the SWF is initialized and communication is possible.
- * @event contentReady
- */
- //Fix for iframe cross-domain issue with FF2x
- try
- {
- this.createEvent("contentReady");
- }
- catch(e){}
-};
-
-YAHOO.extend(YAHOO.widget.FlashAdapter, YAHOO.util.AttributeProvider,
-{
- /**
- * The URL of the SWF file.
- * @property _swfURL
- * @type String
- * @private
- */
- _swfURL: null,
-
- /**
- * The ID of the containing DIV.
- * @property _containerID
- * @type String
- * @private
- */
- _containerID: null,
-
- /**
- * A reference to the embedded SWF file.
- * @property _swf
- * @private
- */
- _swf: null,
-
- /**
- * The id of this instance.
- * @property _id
- * @type String
- * @private
- */
- _id: null,
-
- /**
- * Indicates whether the SWF has been initialized and is ready
- * to communicate with JavaScript
- * @property _initialized
- * @type Boolean
- * @private
- */
- _initialized: false,
-
- /**
- * The initializing attributes are stored here until the SWF is ready.
- * @property _attributes
- * @type Object
- * @private
- */
- _attributes: null, //the intializing attributes
-
- /**
- * Public accessor to the unique name of the FlashAdapter instance.
- *
- * @method toString
- * @return {String} Unique name of the FlashAdapter instance.
- */
- toString: function()
- {
- return "FlashAdapter " + this._id;
- },
-
- /**
- * Nulls out the entire FlashAdapter instance and related objects and removes attached
- * event listeners and clears out DOM elements inside the container. After calling
- * this method, the instance reference should be expliclitly nulled by implementer,
- * as in myChart = null. Use with caution!
- *
- * @method destroy
- */
- destroy: function()
- {
- //kill the Flash Player instance
- if(this._swf)
- {
- var container = YAHOO.util.Dom.get(this._containerID);
- container.removeChild(this._swf);
- }
-
- var instanceName = this._id;
-
- //null out properties
- for(var prop in this)
- {
- if(YAHOO.lang.hasOwnProperty(this, prop))
- {
- this[prop] = null;
- }
- }
-
- },
-
- /**
- * Embeds the SWF in the page and associates it with this instance.
- *
- * @method _embedSWF
- * @private
- */
- _embedSWF: function(swfURL, containerID, swfID, version, backgroundColor, expressInstall, wmode)
- {
- //standard SWFObject embed
- var swfObj = new YAHOO.deconcept.SWFObject(swfURL, swfID, "100%", "100%", version, backgroundColor);
-
- if(expressInstall)
- {
- swfObj.useExpressInstall(expressInstall);
- }
-
- //make sure we can communicate with ExternalInterface
- swfObj.addParam("allowScriptAccess", "always");
-
- if(wmode)
- {
- swfObj.addParam("wmode", wmode);
- }
-
- //again, a useful ExternalInterface trick
- swfObj.addVariable("allowedDomain", document.location.hostname);
-
- //tell the SWF which HTML element it is in
- swfObj.addVariable("elementID", swfID);
-
- // set the name of the function to call when the swf has an event
- swfObj.addVariable("eventHandler", "YAHOO.widget.FlashAdapter.eventHandler");
-
- var container = YAHOO.util.Dom.get(containerID);
- var result = swfObj.write(container);
- if(result)
- {
- this._swf = YAHOO.util.Dom.get(swfID);
- //if successful, let's add an owner property to the SWF reference
- //this will allow the event handler to communicate with a YAHOO.widget.FlashAdapter
- this._swf.owner = this;
- }
- else
- {
- }
- },
-
- /**
- * Handles or re-dispatches events received from the SWF.
- *
- * @method _eventHandler
- * @private
- */
- _eventHandler: function(event)
- {
- var type = event.type;
- switch(type)
- {
- case "swfReady":
- this._loadHandler();
- this.fireEvent("contentReady");
- return;
- case "log":
- return;
- }
-
- //be sure to return after your case or the event will automatically fire!
- this.fireEvent(type, event);
- },
-
- /**
- * Called when the SWF has been initialized.
- *
- * @method _loadHandler
- * @private
- */
- _loadHandler: function()
- {
- this._initialized = false;
- this._initAttributes(this._attributes);
- this.setAttributes(this._attributes, true);
-
- this._initialized = true;
- },
-
- set: function(name, value)
- {
- //save all the attributes in case the swf reloads
- //so that we can pass them in again
- this._attributes[name] = value;
- YAHOO.widget.FlashAdapter.superclass.set.call(this, name, value);
- },
-
- /**
- * Initializes the attributes.
- *
- * @method _initAttributes
- * @private
- */
- _initAttributes: function(attributes)
- {
- //should be overridden if other attributes need to be set up
-
- /**
- * @attribute wmode
- * @description Sets the window mode of the Flash Player control. May be
- * "window", "opaque", or "transparent". Only available in the constructor
- * because it may not be set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute expressInstall
- * @description URL pointing to a SWF file that handles Flash Player's express
- * install feature. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute version
- * @description Minimum required version for the SWF file. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute backgroundColor
- * @description The background color of the SWF. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
-
- /**
- * @attribute altText
- * @description The alternative text to provide for screen readers and other assistive technology.
- * @type String
- */
- this.getAttributeConfig("altText",
- {
- method: this._getAltText
- });
- this.setAttributeConfig("altText",
- {
- method: this._setAltText
- });
-
- /**
- * @attribute swfURL
- * @description Absolute or relative URL to the SWF displayed by the FlashAdapter. Only available in the constructor because it may not be
- * set after Flash Player has been embedded in the page.
- * @type String
- */
- this.getAttributeConfig("swfURL",
- {
- method: this._getSWFURL
- });
- },
-
- /**
- * Getter for swfURL attribute.
- *
- * @method _getSWFURL
- * @private
- */
- _getSWFURL: function()
- {
- return this._swfURL;
- },
-
- /**
- * Getter for altText attribute.
- *
- * @method _getAltText
- * @private
- */
- _getAltText: function()
- {
- return this._swf.getAltText();
- },
-
- /**
- * Setter for altText attribute.
- *
- * @method _setAltText
- * @private
- */
- _setAltText: function(value)
- {
- return this._swf.setAltText(value);
- }
-});
-
-/**
- * Receives event messages from SWF and passes them to the correct instance
- * of FlashAdapter.
- *
- * @method YAHOO.widget.FlashAdapter.eventHandler
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.eventHandler = function(elementID, event)
-{
- var loadedSWF = YAHOO.util.Dom.get(elementID);
- if(!loadedSWF.owner)
- {
- //fix for ie: if owner doesn't exist yet, try again in a moment
- setTimeout(function() { YAHOO.widget.FlashAdapter.eventHandler( elementID, event ); }, 0);
- }
- else
- {
- loadedSWF.owner._eventHandler(event);
- }
-};
-
-/**
- * The number of proxy functions that have been created.
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.proxyFunctionCount = 0;
-
-/**
- * Creates a globally accessible function that wraps a function reference.
- * Returns the proxy function's name as a string for use by the SWF through
- * ExternalInterface.
- *
- * @method YAHOO.widget.FlashAdapter.createProxyFunction
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.createProxyFunction = function(func)
-{
- var index = YAHOO.widget.FlashAdapter.proxyFunctionCount;
- YAHOO.widget.FlashAdapter["proxyFunction" + index] = function()
- {
- return func.apply(null, arguments);
- };
- YAHOO.widget.FlashAdapter.proxyFunctionCount++;
- return "YAHOO.widget.FlashAdapter.proxyFunction" + index.toString();
-};
-
-/**
- * Removes a function created with createProxyFunction()
- *
- * @method YAHOO.widget.FlashAdapter.removeProxyFunction
- * @static
- * @private
- */
-YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
-{
- //quick error check
- if(!funcName || funcName.indexOf("YAHOO.widget.FlashAdapter.proxyFunction") < 0)
- {
- return;
- }
-
- funcName = funcName.substr(26);
- YAHOO.widget.FlashAdapter[funcName] = null;
-};
/**
* The Charts widget provides a Flash control for displaying data
* graphically by series across A-grade browsers with Flash Player installed.
@@ -748,7 +17,7 @@ YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
*
* @namespace YAHOO.widget
* @class Chart
- * @uses YAHOO.widget.FlashAdapter
+ * @uses YAHOO.util.AttributeProvider
* @constructor
* @param type {String} The char type. May be "line", "column", "bar", or "pie"
* @param containerId {HTMLElement} Container element for the Flash Player instance.
@@ -757,11 +26,29 @@ YAHOO.widget.FlashAdapter.removeProxyFunction = function(funcName)
*/
YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
{
- YAHOO.widget.Chart.superclass.constructor.call(this, YAHOO.widget.Chart.SWFURL, containerId, attributes);
+ this._attributes = attributes;
+ this._swfEmbed = new YAHOO.widget.SWF(containerId, YAHOO.widget.Chart.SWFURL, attributes);
+
+ this._swf = this._swfEmbed.swf;
+ //this._swfEmbed.on("swfReady", this._eventHandler);
+ this._swfEmbed.addListener("swfReady", this._eventHandler, null, this);
+ //this._swfEmbed.on("log", this._eventHandler);
this._type = type;
this._dataSource = dataSource;
+
+ /**
+ * Fires when the SWF is initialized and communication is possible.
+ * @event contentReady
+ */
+ //Fix for iframe cross-domain issue with FF2x
+ try
+ {
+ this.createEvent("contentReady");
+ }
+ catch(e){}
+
/**
* Fires when the user moves the mouse over the bounds of an item renderer in the chart.
*
@@ -854,7 +141,7 @@ YAHOO.widget.Chart = function(type, containerId, dataSource, attributes)
this.createEvent("itemDragEndEvent");
};
-YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
+YAHOO.extend(YAHOO.widget.Chart, YAHOO.util.AttributeProvider,
{
/**
* The type of this chart instance.
@@ -882,7 +169,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
/**
* Stores a reference to the dataTipFunction created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _dataTipFunction
* @type String
* @private
@@ -891,7 +178,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
/**
* Stores references to series labelFunction values created by
- * YAHOO.widget.FlashAdapter.createProxyFunction()
+ * YAHOO.widget.Chart.createProxyFunction()
* @property _seriesLabelFunctions
* @type Array
* @private
@@ -970,11 +257,26 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
//remove proxy functions
if(this._dataTipFunction)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);
+ YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);
}
- //call last
- YAHOO.widget.Chart.superclass.destroy.call(this);
+ //kill the Flash Player instance
+ if(this._swf)
+ {
+ var container = YAHOO.util.Dom.get(this._containerID);
+ container.removeChild(this._swf);
+ }
+
+ var instanceName = this._id;
+
+ //null out properties
+ for(var prop in this)
+ {
+ if(YAHOO.lang.hasOwnProperty(this, prop))
+ {
+ this[prop] = null;
+ }
+ }
},
/**
@@ -985,7 +287,61 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
*/
_initAttributes: function(attributes)
{
- YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+ //YAHOO.widget.Chart.superclass._initAttributes.call(this, attributes);
+ /**
+ * @attribute wmode
+ * @description Sets the window mode of the Flash Player control. May be
+ * "window", "opaque", or "transparent". Only available in the constructor
+ * because it may not be set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute expressInstall
+ * @description URL pointing to a SWF file that handles Flash Player's express
+ * install feature. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute version
+ * @description Minimum required version for the SWF file. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute backgroundColor
+ * @description The background color of the SWF. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+
+ /**
+ * @attribute altText
+ * @description The alternative text to provide for screen readers and other assistive technology.
+ * @type String
+ */
+ this.getAttributeConfig("altText",
+ {
+ method: this._getAltText
+ });
+ this.setAttributeConfig("altText",
+ {
+ method: this._setAltText
+ });
+
+ /**
+ * @attribute swfURL
+ * @description Absolute or relative URL to the SWF displayed by the Chart. Only available in the constructor because it may not be
+ * set after Flash Player has been embedded in the page.
+ * @type String
+ */
+ this.getAttributeConfig("swfURL",
+ {
+ method: this._getSWFURL
+ });
/**
* @attribute request
@@ -1082,6 +438,28 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
},
/**
+ * Handles or re-dispatches events received from the SWF.
+ *
+ * @method _eventHandler
+ * @private
+ */
+ _eventHandler: function(event)
+ {
+ var type = event.type;
+ switch(type)
+ {
+ case "swfReady":
+ this._swf = this._swfEmbed._swf;
+ this._loadHandler();
+ this.fireEvent("contentReady");
+ return;
+ case "log":
+ this.fireEvent(type, event);
+ return;
+ }
+ },
+
+ /**
* Called when the SWF is ready for communication. Sets the type, initializes
* the styles, and sets the DataSource.
*
@@ -1092,21 +470,26 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
//the type is set separately because it must be first!
this._swf.setType(this._type);
-
+
+
//set initial styles
if(this._attributes.style)
{
var style = this._attributes.style;
this.setStyles(style);
}
-
- YAHOO.widget.Chart.superclass._loadHandler.call(this);
-
+
+ this._initialized = false;
+
+ this._initAttributes(this._attributes);
+ this.setAttributes(this._attributes, true);
+
+ this._initialized = true;
if(this._dataSource)
{
this.set("dataSource", this._dataSource);
}
- },
+ },
/**
* Sends (or resends) the request to the DataSource.
@@ -1158,7 +541,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
var count = this._seriesLabelFunctions.length;
for(i = 0; i < count; i++)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._seriesLabelFunctions[i]);
+ YAHOO.widget.Chart.removeProxyFunction(this._seriesLabelFunctions[i]);
}
this._seriesLabelFunction = null;
}
@@ -1193,7 +576,7 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
if(currentSeries.labelFunction !== null &&
typeof currentSeries.labelFunction == "function")
{
- clonedSeries.labelFunction = YAHOO.widget.FlashAdapter.createProxyFunction(currentSeries.labelFunction);
+ clonedSeries.labelFunction = YAHOO.widget.Chart.createProxyFunction(currentSeries.labelFunction);
this._seriesLabelFunctions.push(clonedSeries.labelFunction);
}
}
@@ -1355,12 +738,12 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
if(this._dataTipFunction)
{
- YAHOO.widget.FlashAdapter.removeProxyFunction(this._dataTipFunction);
+ YAHOO.widget.Chart.removeProxyFunction(this._dataTipFunction);
}
if(value && typeof value == "function")
{
- value = YAHOO.widget.FlashAdapter.createProxyFunction(value);
+ value = YAHOO.widget.Chart.createProxyFunction(value);
this._dataTipFunction = value;
}
this._swf.setDataTipFunction(value);
@@ -1387,10 +770,176 @@ YAHOO.extend(YAHOO.widget.Chart, YAHOO.widget.FlashAdapter,
{
this._pollingInterval = value;
this.refreshData();
+ },
+
+ /**
+ * The javascript wrapper for the swf object
+ *
+ * @property _swfEmbed
+ * @type swf
+ * @private
+ */
+ _swfEmbed: null,
+
+ /**
+ * The URL of the SWF file.
+ * @property _swfURL
+ * @type String
+ * @private
+ */
+ _swfURL: null,
+
+ /**
+ * The ID of the containing DIV.
+ * @property _containerID
+ * @type String
+ * @private
+ */
+ _containerID: null,
+
+ /**
+ * A reference to the embedded SWF file.
+ * @property _swf
+ * @private
+ */
+ _swf: null,
+
+ /**
+ * The id of this instance.
+ * @property _id
+ * @type String
+ * @private
+ */
+ _id: null,
+
+ /**
+ * Indicates whether the SWF has been initialized and is ready
+ * to communicate with JavaScript
+ * @property _initialized
+ * @type Boolean
+ * @private
+ */
+ _initialized: false,
+
+ /**
+ * The initializing attributes are stored here until the SWF is ready.
+ * @property _attributes
+ * @type Object
+ * @private
+ */
+ _attributes: null, //the intializing attributes
+
+ set: function(name, value)
+ {
+ //save all the attributes in case the swf reloads
+ //so that we can pass them in again
+ this._attributes[name] = value;
+ YAHOO.widget.Chart.superclass.set.call(this, name, value);
+ },
+
+ /**
+ * Getter for swfURL attribute.
+ *
+ * @method _getSWFURL
+ * @private
+ */
+ _getSWFURL: function()
+ {
+ return this._swfURL;
+ },
+
+ /**
+ * Getter for altText attribute.
+ *
+ * @method _getAltText
+ * @private
+ */
+ _getAltText: function()
+ {
+ return this._swf.getAltText();
+ },
+
+ /**
+ * Setter for altText attribute.
+ *
+ * @method _setAltText
+ * @private
+ */
+ _setAltText: function(value)
+ {
+ return this._swf.setAltText(value);
}
});
/**
+ * Receives event messages from SWF and passes them to the correct instance
+ * of Chart.
+ *
+ * @method YAHOO.widget.Chart.eventHandler
+ * @static
+ * @private
+ */
+YAHOO.widget.Chart.eventHandler = function(elementID, event)
+{
+ var loadedSWF = YAHOO.util.Dom.get(elementID);