You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1941 lines
65 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. This file is part of Ext JS 3.4
  3. Copyright (c) 2011-2013 Sencha Inc
  4. Contact: http://www.sencha.com/contact
  5. GNU General Public License Usage
  6. This file may be used under the terms of the GNU General Public License version 3.0 as
  7. published by the Free Software Foundation and appearing in the file LICENSE included in the
  8. packaging of this file.
  9. Please review the following information to ensure the GNU General Public License version 3.0
  10. requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  11. If you are unsure which license is appropriate for your use, please contact the sales department
  12. at http://www.sencha.com/contact.
  13. Build date: 2013-04-03 15:07:25
  14. */
  15. /*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
  16. is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
  17. */
  18. var swfobject = function() {
  19. var UNDEF = "undefined",
  20. OBJECT = "object",
  21. SHOCKWAVE_FLASH = "Shockwave Flash",
  22. SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
  23. FLASH_MIME_TYPE = "application/x-shockwave-flash",
  24. EXPRESS_INSTALL_ID = "SWFObjectExprInst",
  25. ON_READY_STATE_CHANGE = "onreadystatechange",
  26. win = window,
  27. doc = document,
  28. nav = navigator,
  29. plugin = false,
  30. domLoadFnArr = [main],
  31. regObjArr = [],
  32. objIdArr = [],
  33. listenersArr = [],
  34. storedAltContent,
  35. storedAltContentId,
  36. storedCallbackFn,
  37. storedCallbackObj,
  38. isDomLoaded = false,
  39. isExpressInstallActive = false,
  40. dynamicStylesheet,
  41. dynamicStylesheetMedia,
  42. autoHideShow = true,
  43. /* Centralized function for browser feature detection
  44. - User agent string detection is only used when no good alternative is possible
  45. - Is executed directly for optimal performance
  46. */
  47. ua = function() {
  48. var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
  49. u = nav.userAgent.toLowerCase(),
  50. p = nav.platform.toLowerCase(),
  51. windows = p ? (/win/).test(p) : /win/.test(u),
  52. mac = p ? (/mac/).test(p) : /mac/.test(u),
  53. webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
  54. ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
  55. playerVersion = [0,0,0],
  56. d = null;
  57. if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
  58. d = nav.plugins[SHOCKWAVE_FLASH].description;
  59. if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
  60. plugin = true;
  61. ie = false; // cascaded feature detection for Internet Explorer
  62. d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
  63. playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
  64. playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
  65. playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
  66. }
  67. }
  68. else if (typeof win.ActiveXObject != UNDEF) {
  69. try {
  70. var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
  71. if (a) { // a will return null when ActiveX is disabled
  72. d = a.GetVariable("$version");
  73. if (d) {
  74. ie = true; // cascaded feature detection for Internet Explorer
  75. d = d.split(" ")[1].split(",");
  76. playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
  77. }
  78. }
  79. }
  80. catch(e) {}
  81. }
  82. return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
  83. }(),
  84. /* Cross-browser onDomLoad
  85. - Will fire an event as soon as the DOM of a web page is loaded
  86. - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
  87. - Regular onload serves as fallback
  88. */
  89. onDomLoad = function() {
  90. if (!ua.w3) { return; }
  91. if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
  92. callDomLoadFunctions();
  93. }
  94. if (!isDomLoaded) {
  95. if (typeof doc.addEventListener != UNDEF) {
  96. doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
  97. }
  98. if (ua.ie && ua.win) {
  99. doc.attachEvent(ON_READY_STATE_CHANGE, function() {
  100. if (doc.readyState == "complete") {
  101. doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
  102. callDomLoadFunctions();
  103. }
  104. });
  105. if (win == top) { // if not inside an iframe
  106. (function(){
  107. if (isDomLoaded) { return; }
  108. try {
  109. doc.documentElement.doScroll("left");
  110. }
  111. catch(e) {
  112. setTimeout(arguments.callee, 0);
  113. return;
  114. }
  115. callDomLoadFunctions();
  116. })();
  117. }
  118. }
  119. if (ua.wk) {
  120. (function(){
  121. if (isDomLoaded) { return; }
  122. if (!(/loaded|complete/).test(doc.readyState)) {
  123. setTimeout(arguments.callee, 0);
  124. return;
  125. }
  126. callDomLoadFunctions();
  127. })();
  128. }
  129. addLoadEvent(callDomLoadFunctions);
  130. }
  131. }();
  132. function callDomLoadFunctions() {
  133. if (isDomLoaded) { return; }
  134. try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
  135. var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
  136. t.parentNode.removeChild(t);
  137. }
  138. catch (e) { return; }
  139. isDomLoaded = true;
  140. var dl = domLoadFnArr.length;
  141. for (var i = 0; i < dl; i++) {
  142. domLoadFnArr[i]();
  143. }
  144. }
  145. function addDomLoadEvent(fn) {
  146. if (isDomLoaded) {
  147. fn();
  148. }
  149. else {
  150. domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
  151. }
  152. }
  153. /* Cross-browser onload
  154. - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
  155. - Will fire an event as soon as a web page including all of its assets are loaded
  156. */
  157. function addLoadEvent(fn) {
  158. if (typeof win.addEventListener != UNDEF) {
  159. win.addEventListener("load", fn, false);
  160. }
  161. else if (typeof doc.addEventListener != UNDEF) {
  162. doc.addEventListener("load", fn, false);
  163. }
  164. else if (typeof win.attachEvent != UNDEF) {
  165. addListener(win, "onload", fn);
  166. }
  167. else if (typeof win.onload == "function") {
  168. var fnOld = win.onload;
  169. win.onload = function() {
  170. fnOld();
  171. fn();
  172. };
  173. }
  174. else {
  175. win.onload = fn;
  176. }
  177. }
  178. /* Main function
  179. - Will preferably execute onDomLoad, otherwise onload (as a fallback)
  180. */
  181. function main() {
  182. if (plugin) {
  183. testPlayerVersion();
  184. }
  185. else {
  186. matchVersions();
  187. }
  188. }
  189. /* Detect the Flash Player version for non-Internet Explorer browsers
  190. - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
  191. a. Both release and build numbers can be detected
  192. b. Avoid wrong descriptions by corrupt installers provided by Adobe
  193. c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
  194. - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
  195. */
  196. function testPlayerVersion() {
  197. var b = doc.getElementsByTagName("body")[0];
  198. var o = createElement(OBJECT);
  199. o.setAttribute("type", FLASH_MIME_TYPE);
  200. var t = b.appendChild(o);
  201. if (t) {
  202. var counter = 0;
  203. (function(){
  204. if (typeof t.GetVariable != UNDEF) {
  205. var d = t.GetVariable("$version");
  206. if (d) {
  207. d = d.split(" ")[1].split(",");
  208. ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
  209. }
  210. }
  211. else if (counter < 10) {
  212. counter++;
  213. setTimeout(arguments.callee, 10);
  214. return;
  215. }
  216. b.removeChild(o);
  217. t = null;
  218. matchVersions();
  219. })();
  220. }
  221. else {
  222. matchVersions();
  223. }
  224. }
  225. /* Perform Flash Player and SWF version matching; static publishing only
  226. */
  227. function matchVersions() {
  228. var rl = regObjArr.length;
  229. if (rl > 0) {
  230. for (var i = 0; i < rl; i++) { // for each registered object element
  231. var id = regObjArr[i].id;
  232. var cb = regObjArr[i].callbackFn;
  233. var cbObj = {success:false, id:id};
  234. if (ua.pv[0] > 0) {
  235. var obj = getElementById(id);
  236. if (obj) {
  237. if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
  238. setVisibility(id, true);
  239. if (cb) {
  240. cbObj.success = true;
  241. cbObj.ref = getObjectById(id);
  242. cb(cbObj);
  243. }
  244. }
  245. else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
  246. var att = {};
  247. att.data = regObjArr[i].expressInstall;
  248. att.width = obj.getAttribute("width") || "0";
  249. att.height = obj.getAttribute("height") || "0";
  250. if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
  251. if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
  252. // parse HTML object param element's name-value pairs
  253. var par = {};
  254. var p = obj.getElementsByTagName("param");
  255. var pl = p.length;
  256. for (var j = 0; j < pl; j++) {
  257. if (p[j].getAttribute("name").toLowerCase() != "movie") {
  258. par[p[j].getAttribute("name")] = p[j].getAttribute("value");
  259. }
  260. }
  261. showExpressInstall(att, par, id, cb);
  262. }
  263. else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
  264. displayAltContent(obj);
  265. if (cb) { cb(cbObj); }
  266. }
  267. }
  268. }
  269. else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
  270. setVisibility(id, true);
  271. if (cb) {
  272. var o = getObjectById(id); // test whether there is an HTML object element or not
  273. if (o && typeof o.SetVariable != UNDEF) {
  274. cbObj.success = true;
  275. cbObj.ref = o;
  276. }
  277. cb(cbObj);
  278. }
  279. }
  280. }
  281. }
  282. }
  283. function getObjectById(objectIdStr) {
  284. var r = null;
  285. var o = getElementById(objectIdStr);
  286. if (o && o.nodeName == "OBJECT") {
  287. if (typeof o.SetVariable != UNDEF) {
  288. r = o;
  289. }
  290. else {
  291. var n = o.getElementsByTagName(OBJECT)[0];
  292. if (n) {
  293. r = n;
  294. }
  295. }
  296. }
  297. return r;
  298. }
  299. /* Requirements for Adobe Express Install
  300. - only one instance can be active at a time
  301. - fp 6.0.65 or higher
  302. - Win/Mac OS only
  303. - no Webkit engines older than version 312
  304. */
  305. function canExpressInstall() {
  306. return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
  307. }
  308. /* Show the Adobe Express Install dialog
  309. - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
  310. */
  311. function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
  312. isExpressInstallActive = true;
  313. storedCallbackFn = callbackFn || null;
  314. storedCallbackObj = {success:false, id:replaceElemIdStr};
  315. var obj = getElementById(replaceElemIdStr);
  316. if (obj) {
  317. if (obj.nodeName == "OBJECT") { // static publishing
  318. storedAltContent = abstractAltContent(obj);
  319. storedAltContentId = null;
  320. }
  321. else { // dynamic publishing
  322. storedAltContent = obj;
  323. storedAltContentId = replaceElemIdStr;
  324. }
  325. att.id = EXPRESS_INSTALL_ID;
  326. if (typeof att.width == UNDEF || (!(/%$/).test(att.width) && parseInt(att.width, 10) < 310)) {
  327. att.width = "310";
  328. }
  329. if (typeof att.height == UNDEF || (!(/%$/).test(att.height) && parseInt(att.height, 10) < 137)) {
  330. att.height = "137";
  331. }
  332. doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
  333. var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
  334. fv = "MMredirectURL=" + win.location.toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
  335. if (typeof par.flashvars != UNDEF) {
  336. par.flashvars += "&" + fv;
  337. }
  338. else {
  339. par.flashvars = fv;
  340. }
  341. // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
  342. // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
  343. if (ua.ie && ua.win && obj.readyState != 4) {
  344. var newObj = createElement("div");
  345. replaceElemIdStr += "SWFObjectNew";
  346. newObj.setAttribute("id", replaceElemIdStr);
  347. obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
  348. obj.style.display = "none";
  349. (function(){
  350. if (obj.readyState == 4) {
  351. obj.parentNode.removeChild(obj);
  352. }
  353. else {
  354. setTimeout(arguments.callee, 10);
  355. }
  356. })();
  357. }
  358. createSWF(att, par, replaceElemIdStr);
  359. }
  360. }
  361. /* Functions to abstract and display alternative content
  362. */
  363. function displayAltContent(obj) {
  364. if (ua.ie && ua.win && obj.readyState != 4) {
  365. // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
  366. // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
  367. var el = createElement("div");
  368. obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
  369. el.parentNode.replaceChild(abstractAltContent(obj), el);
  370. obj.style.display = "none";
  371. (function(){
  372. if (obj.readyState == 4) {
  373. obj.parentNode.removeChild(obj);
  374. }
  375. else {
  376. setTimeout(arguments.callee, 10);
  377. }
  378. })();
  379. }
  380. else {
  381. obj.parentNode.replaceChild(abstractAltContent(obj), obj);
  382. }
  383. }
  384. function abstractAltContent(obj) {
  385. var ac = createElement("div");
  386. if (ua.win && ua.ie) {
  387. ac.innerHTML = obj.innerHTML;
  388. }
  389. else {
  390. var nestedObj = obj.getElementsByTagName(OBJECT)[0];
  391. if (nestedObj) {
  392. var c = nestedObj.childNodes;
  393. if (c) {
  394. var cl = c.length;
  395. for (var i = 0; i < cl; i++) {
  396. if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
  397. ac.appendChild(c[i].cloneNode(true));
  398. }
  399. }
  400. }
  401. }
  402. }
  403. return ac;
  404. }
  405. /* Cross-browser dynamic SWF creation
  406. */
  407. function createSWF(attObj, parObj, id) {
  408. var r, el = getElementById(id);
  409. if (ua.wk && ua.wk < 312) { return r; }
  410. if (el) {
  411. if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
  412. attObj.id = id;
  413. }
  414. if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
  415. var att = "";
  416. for (var i in attObj) {
  417. if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
  418. if (i.toLowerCase() == "data") {
  419. parObj.movie = attObj[i];
  420. }
  421. else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
  422. att += ' class="' + attObj[i] + '"';
  423. }
  424. else if (i.toLowerCase() != "classid") {
  425. att += ' ' + i + '="' + attObj[i] + '"';
  426. }
  427. }
  428. }
  429. var par = "";
  430. for (var j in parObj) {
  431. if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
  432. par += '<param name="' + j + '" value="' + parObj[j] + '" />';
  433. }
  434. }
  435. el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
  436. objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
  437. r = getElementById(attObj.id);
  438. }
  439. else { // well-behaving browsers
  440. var o = createElement(OBJECT);
  441. o.setAttribute("type", FLASH_MIME_TYPE);
  442. for (var m in attObj) {
  443. if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
  444. if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
  445. o.setAttribute("class", attObj[m]);
  446. }
  447. else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
  448. o.setAttribute(m, attObj[m]);
  449. }
  450. }
  451. }
  452. for (var n in parObj) {
  453. if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
  454. createObjParam(o, n, parObj[n]);
  455. }
  456. }
  457. el.parentNode.replaceChild(o, el);
  458. r = o;
  459. }
  460. }
  461. return r;
  462. }
  463. function createObjParam(el, pName, pValue) {
  464. var p = createElement("param");
  465. p.setAttribute("name", pName);
  466. p.setAttribute("value", pValue);
  467. el.appendChild(p);
  468. }
  469. /* Cross-browser SWF removal
  470. - Especially needed to safely and completely remove a SWF in Internet Explorer
  471. */
  472. function removeSWF(id) {
  473. var obj = getElementById(id);
  474. if (obj && obj.nodeName == "OBJECT") {
  475. if (ua.ie && ua.win) {
  476. obj.style.display = "none";
  477. (function(){
  478. if (obj.readyState == 4) {
  479. removeObjectInIE(id);
  480. }
  481. else {
  482. setTimeout(arguments.callee, 10);
  483. }
  484. })();
  485. }
  486. else {
  487. obj.parentNode.removeChild(obj);
  488. }
  489. }
  490. }
  491. function removeObjectInIE(id) {
  492. var obj = getElementById(id);
  493. if (obj) {
  494. for (var i in obj) {
  495. if (typeof obj[i] == "function") {
  496. obj[i] = null;
  497. }
  498. }
  499. obj.parentNode.removeChild(obj);
  500. }
  501. }
  502. /* Functions to optimize JavaScript compression
  503. */
  504. function getElementById(id) {
  505. var el = null;
  506. try {
  507. el = doc.getElementById(id);
  508. }
  509. catch (e) {}
  510. return el;
  511. }
  512. function createElement(el) {
  513. return doc.createElement(el);
  514. }
  515. /* Updated attachEvent function for Internet Explorer
  516. - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
  517. */
  518. function addListener(target, eventType, fn) {
  519. target.attachEvent(eventType, fn);
  520. listenersArr[listenersArr.length] = [target, eventType, fn];
  521. }
  522. /* Flash Player and SWF content version matching
  523. */
  524. function hasPlayerVersion(rv) {
  525. var pv = ua.pv, v = rv.split(".");
  526. v[0] = parseInt(v[0], 10);
  527. v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
  528. v[2] = parseInt(v[2], 10) || 0;
  529. return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
  530. }
  531. /* Cross-browser dynamic CSS creation
  532. - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
  533. */
  534. function createCSS(sel, decl, media, newStyle) {
  535. if (ua.ie && ua.mac) { return; }
  536. var h = doc.getElementsByTagName("head")[0];
  537. if (!h) { return; } // to also support badly authored HTML pages that lack a head element
  538. var m = (media && typeof media == "string") ? media : "screen";
  539. if (newStyle) {
  540. dynamicStylesheet = null;
  541. dynamicStylesheetMedia = null;
  542. }
  543. if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
  544. // create dynamic stylesheet + get a global reference to it
  545. var s = createElement("style");
  546. s.setAttribute("type", "text/css");
  547. s.setAttribute("media", m);
  548. dynamicStylesheet = h.appendChild(s);
  549. if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
  550. dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
  551. }
  552. dynamicStylesheetMedia = m;
  553. }
  554. // add style rule
  555. if (ua.ie && ua.win) {
  556. if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
  557. dynamicStylesheet.addRule(sel, decl);
  558. }
  559. }
  560. else {
  561. if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
  562. dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
  563. }
  564. }
  565. }
  566. function setVisibility(id, isVisible) {
  567. if (!autoHideShow) { return; }
  568. var v = isVisible ? "visible" : "hidden";
  569. if (isDomLoaded && getElementById(id)) {
  570. getElementById(id).style.visibility = v;
  571. }
  572. else {
  573. createCSS("#" + id, "visibility:" + v);
  574. }
  575. }
  576. /* Filter to avoid XSS attacks
  577. */
  578. function urlEncodeIfNecessary(s) {
  579. var regex = /[\\\"<>\.;]/;
  580. var hasBadChars = regex.exec(s) != null;
  581. return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
  582. }
  583. /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
  584. */
  585. var cleanup = function() {
  586. if (ua.ie && ua.win) {
  587. window.attachEvent("onunload", function() {
  588. // remove listeners to avoid memory leaks
  589. var ll = listenersArr.length;
  590. for (var i = 0; i < ll; i++) {
  591. listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
  592. }
  593. // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
  594. var il = objIdArr.length;
  595. for (var j = 0; j < il; j++) {
  596. removeSWF(objIdArr[j]);
  597. }
  598. // cleanup library's main closures to avoid memory leaks
  599. for (var k in ua) {
  600. ua[k] = null;
  601. }
  602. ua = null;
  603. for (var l in swfobject) {
  604. swfobject[l] = null;
  605. }
  606. swfobject = null;
  607. window.detachEvent('onunload', arguments.callee);
  608. });
  609. }
  610. }();
  611. return {
  612. /* Public API
  613. - Reference: http://code.google.com/p/swfobject/wiki/documentation
  614. */
  615. registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
  616. if (ua.w3 && objectIdStr && swfVersionStr) {
  617. var regObj = {};
  618. regObj.id = objectIdStr;
  619. regObj.swfVersion = swfVersionStr;
  620. regObj.expressInstall = xiSwfUrlStr;
  621. regObj.callbackFn = callbackFn;
  622. regObjArr[regObjArr.length] = regObj;
  623. setVisibility(objectIdStr, false);
  624. }
  625. else if (callbackFn) {
  626. callbackFn({success:false, id:objectIdStr});
  627. }
  628. },
  629. getObjectById: function(objectIdStr) {
  630. if (ua.w3) {
  631. return getObjectById(objectIdStr);
  632. }
  633. },
  634. embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
  635. var callbackObj = {success:false, id:replaceElemIdStr};
  636. if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
  637. setVisibility(replaceElemIdStr, false);
  638. addDomLoadEvent(function() {
  639. widthStr += ""; // auto-convert to string
  640. heightStr += "";
  641. var att = {};
  642. if (attObj && typeof attObj === OBJECT) {
  643. for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
  644. att[i] = attObj[i];
  645. }
  646. }
  647. att.data = swfUrlStr;
  648. att.width = widthStr;
  649. att.height = heightStr;
  650. var par = {};
  651. if (parObj && typeof parObj === OBJECT) {
  652. for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
  653. par[j] = parObj[j];
  654. }
  655. }
  656. if (flashvarsObj && typeof flashvarsObj === OBJECT) {
  657. for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
  658. if (typeof par.flashvars != UNDEF) {
  659. par.flashvars += "&" + k + "=" + flashvarsObj[k];
  660. }
  661. else {
  662. par.flashvars = k + "=" + flashvarsObj[k];
  663. }
  664. }
  665. }
  666. if (hasPlayerVersion(swfVersionStr)) { // create SWF
  667. var obj = createSWF(att, par, replaceElemIdStr);
  668. if (att.id == replaceElemIdStr) {
  669. setVisibility(replaceElemIdStr, true);
  670. }
  671. callbackObj.success = true;
  672. callbackObj.ref = obj;
  673. }
  674. else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
  675. att.data = xiSwfUrlStr;
  676. showExpressInstall(att, par, replaceElemIdStr, callbackFn);
  677. return;
  678. }
  679. else { // show alternative content
  680. setVisibility(replaceElemIdStr, true);
  681. }
  682. if (callbackFn) { callbackFn(callbackObj); }
  683. });
  684. }
  685. else if (callbackFn) { callbackFn(callbackObj); }
  686. },
  687. switchOffAutoHideShow: function() {
  688. autoHideShow = false;
  689. },
  690. ua: ua,
  691. getFlashPlayerVersion: function() {
  692. return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
  693. },
  694. hasFlashPlayerVersion: hasPlayerVersion,
  695. createSWF: function(attObj, parObj, replaceElemIdStr) {
  696. if (ua.w3) {
  697. return createSWF(attObj, parObj, replaceElemIdStr);
  698. }
  699. else {
  700. return undefined;
  701. }
  702. },
  703. showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
  704. if (ua.w3 && canExpressInstall()) {
  705. showExpressInstall(att, par, replaceElemIdStr, callbackFn);
  706. }
  707. },
  708. removeSWF: function(objElemIdStr) {
  709. if (ua.w3) {
  710. removeSWF(objElemIdStr);
  711. }
  712. },
  713. createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
  714. if (ua.w3) {
  715. createCSS(selStr, declStr, mediaStr, newStyleBoolean);
  716. }
  717. },
  718. addDomLoadEvent: addDomLoadEvent,
  719. addLoadEvent: addLoadEvent,
  720. getQueryParamValue: function(param) {
  721. var q = doc.location.search || doc.location.hash;
  722. if (q) {
  723. if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
  724. if (param == null) {
  725. return urlEncodeIfNecessary(q);
  726. }
  727. var pairs = q.split("&");
  728. for (var i = 0; i < pairs.length; i++) {
  729. if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
  730. return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
  731. }
  732. }
  733. }
  734. return "";
  735. },
  736. // For internal usage only
  737. expressInstallCallback: function() {
  738. if (isExpressInstallActive) {
  739. var obj = getElementById(EXPRESS_INSTALL_ID);
  740. if (obj && storedAltContent) {
  741. obj.parentNode.replaceChild(storedAltContent, obj);
  742. if (storedAltContentId) {
  743. setVisibility(storedAltContentId, true);
  744. if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
  745. }
  746. if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
  747. }
  748. isExpressInstallActive = false;
  749. }
  750. }
  751. };
  752. }();
  753. /**
  754. * @class Ext.FlashComponent
  755. * @extends Ext.BoxComponent
  756. * @constructor
  757. * @xtype flash
  758. */
  759. Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
  760. /**
  761. * @cfg {String} flashVersion
  762. * Indicates the version the flash content was published for. Defaults to <tt>'9.0.115'</tt>.
  763. */
  764. flashVersion : '9.0.115',
  765. /**
  766. * @cfg {String} backgroundColor
  767. * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
  768. */
  769. backgroundColor: '#ffffff',
  770. /**
  771. * @cfg {String} wmode
  772. * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
  773. */
  774. wmode: 'opaque',
  775. /**
  776. * @cfg {Object} flashVars
  777. * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
  778. */
  779. flashVars: undefined,
  780. /**
  781. * @cfg {Object} flashParams
  782. * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
  783. * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
  784. */
  785. flashParams: undefined,
  786. /**
  787. * @cfg {String} url
  788. * The URL of the chart to include. Defaults to <tt>undefined</tt>.
  789. */
  790. url: undefined,
  791. swfId : undefined,
  792. swfWidth: '100%',
  793. swfHeight: '100%',
  794. /**
  795. * @cfg {Boolean} expressInstall
  796. * True to prompt the user to install flash if not installed. Note that this uses
  797. * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
  798. */
  799. expressInstall: false,
  800. initComponent : function(){
  801. Ext.FlashComponent.superclass.initComponent.call(this);
  802. this.addEvents(
  803. /**
  804. * @event initialize
  805. *
  806. * @param {Chart} this
  807. */
  808. 'initialize'
  809. );
  810. },
  811. onRender : function(){
  812. Ext.FlashComponent.superclass.onRender.apply(this, arguments);
  813. var params = Ext.apply({
  814. allowScriptAccess: 'always',
  815. bgcolor: this.backgroundColor,
  816. wmode: this.wmode
  817. }, this.flashParams), vars = Ext.apply({
  818. allowedDomain: document.location.hostname,
  819. YUISwfId: this.getId(),
  820. YUIBridgeCallback: 'Ext.FlashEventProxy.onEvent'
  821. }, this.flashVars);
  822. new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
  823. this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
  824. this.swf = Ext.getDom(this.id);
  825. this.el = Ext.get(this.swf);
  826. },
  827. getSwfId : function(){
  828. return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
  829. },
  830. getId : function(){
  831. return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
  832. },
  833. onFlashEvent : function(e){
  834. switch(e.type){
  835. case "swfReady":
  836. this.initSwf();
  837. return;
  838. case "log":
  839. return;
  840. }
  841. e.component = this;
  842. this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
  843. },
  844. initSwf : function(){
  845. this.onSwfReady(!!this.isInitialized);
  846. this.isInitialized = true;
  847. this.fireEvent('initialize', this);
  848. },
  849. beforeDestroy: function(){
  850. if(this.rendered){
  851. swfobject.removeSWF(this.swf.id);
  852. }
  853. Ext.FlashComponent.superclass.beforeDestroy.call(this);
  854. },
  855. onSwfReady : Ext.emptyFn
  856. });
  857. /**
  858. * Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
  859. * @static
  860. * @type String
  861. */
  862. Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
  863. Ext.reg('flash', Ext.FlashComponent);/**
  864. * @class Ext.FlashProxy
  865. * @singleton
  866. */
  867. Ext.FlashEventProxy = {
  868. onEvent : function(id, e){
  869. var fp = Ext.getCmp(id);
  870. if(fp){
  871. fp.onFlashEvent(e);
  872. }else{
  873. arguments.callee.defer(10, this, [id, e]);
  874. }
  875. }
  876. };/**
  877. * @class Ext.chart.Chart
  878. * @extends Ext.FlashComponent
  879. * The Ext.chart package provides the capability to visualize data with flash based charting.
  880. * Each chart binds directly to an Ext.data.Store enabling automatic updates of the chart.
  881. * To change the look and feel of a chart, see the {@link #chartStyle} and {@link #extraStyle} config options.
  882. * @constructor
  883. * @xtype chart
  884. */
  885. Ext.chart.Chart = Ext.extend(Ext.FlashComponent, {
  886. refreshBuffer: 100,
  887. /**
  888. * @cfg {String} backgroundColor
  889. * @hide
  890. */
  891. /**
  892. * @cfg {Object} chartStyle
  893. * Sets styles for this chart. This contains default styling, so modifying this property will <b>override</b>
  894. * the built in styles of the chart. Use {@link #extraStyle} to add customizations to the default styling.
  895. */
  896. chartStyle: {
  897. padding: 10,
  898. animationEnabled: true,
  899. font: {
  900. name: 'Tahoma',
  901. color: 0x444444,
  902. size: 11
  903. },
  904. dataTip: {
  905. padding: 5,
  906. border: {
  907. color: 0x99bbe8,
  908. size:1
  909. },
  910. background: {
  911. color: 0xDAE7F6,
  912. alpha: .9
  913. },
  914. font: {
  915. name: 'Tahoma',
  916. color: 0x15428B,
  917. size: 10,
  918. bold: true
  919. }
  920. }
  921. },
  922. /**
  923. * @cfg {String} url
  924. * The url to load the chart from. This defaults to Ext.chart.Chart.CHART_URL, which should
  925. * be modified to point to the local charts resource.
  926. */
  927. /**
  928. * @cfg {Object} extraStyle
  929. * Contains extra styles that will be added or overwritten to the default chartStyle. Defaults to <tt>null</tt>.
  930. * For a detailed list of the options available, visit the YUI Charts site
  931. * at <a href="http://developer.yahoo.com/yui/charts/#basicstyles">http://developer.yahoo.com/yui/charts/#basicstyles</a><br/>
  932. * Some of the options availabe:<br />
  933. * <ul style="padding:5px;padding-left:16px;list-style-type:inherit;">
  934. * <li><b>padding</b> - The space around the edge of the chart's contents. Padding does not increase the size of the chart.</li>
  935. * <li><b>animationEnabled</b> - A Boolean value that specifies whether marker animations are enabled or not. Enabled by default.</li>
  936. * <li><b>font</b> - An Object defining the font style to be used in the chart. Defaults to <tt>{ name: 'Tahoma', color: 0x444444, size: 11 }</tt><br/>
  937. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  938. * <li><b>name</b> - font name</li>
  939. * <li><b>color</b> - font color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
  940. * <li><b>size</b> - font size in points (numeric portion only, ie: 11)</li>
  941. * <li><b>bold</b> - boolean</li>
  942. * <li><b>italic</b> - boolean</li>
  943. * <li><b>underline</b> - boolean</li>
  944. * </ul>
  945. * </li>
  946. * <li><b>border</b> - An object defining the border style around the chart. The chart itself will decrease in dimensions to accomodate the border.<br/>
  947. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  948. * <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
  949. * <li><b>size</b> - border size in pixels (numeric portion only, ie: 1)</li>
  950. * </ul>
  951. * </li>
  952. * <li><b>background</b> - An object defining the background style of the chart.<br/>
  953. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  954. * <li><b>color</b> - border color (hex code, ie: "#ff0000", "ff0000" or 0xff0000)</li>
  955. * <li><b>image</b> - an image URL. May be relative to the current document or absolute.</li>
  956. * </ul>
  957. * </li>
  958. * <li><b>legend</b> - An object defining the legend style<br/>
  959. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  960. * <li><b>display</b> - location of the legend. Possible values are "none", "left", "right", "top", and "bottom".</li>
  961. * <li><b>spacing</b> - an image URL. May be relative to the current document or absolute.</li>
  962. * <li><b>padding, border, background, font</b> - same options as described above.</li>
  963. * </ul></li>
  964. * <li><b>dataTip</b> - An object defining the style of the data tip (tooltip).<br/>
  965. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  966. * <li><b>padding, border, background, font</b> - same options as described above.</li>
  967. * </ul></li>
  968. * <li><b>xAxis and yAxis</b> - An object defining the style of the style of either axis.<br/>
  969. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  970. * <li><b>color</b> - same option as described above.</li>
  971. * <li><b>size</b> - same option as described above.</li>
  972. * <li><b>showLabels</b> - boolean</li>
  973. * <li><b>labelRotation</b> - a value in degrees from -90 through 90. Default is zero.</li>
  974. * </ul></li>
  975. * <li><b>majorGridLines and minorGridLines</b> - An object defining the style of the style of the grid lines.<br/>
  976. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  977. * <li><b>color, size</b> - same options as described above.</li>
  978. * </ul></li></li>
  979. * <li><b>zeroGridLine</b> - An object defining the style of the style of the zero grid line.<br/>
  980. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  981. * <li><b>color, size</b> - same options as described above.</li>
  982. * </ul></li></li>
  983. * <li><b>majorTicks and minorTicks</b> - An object defining the style of the style of ticks in the chart.<br/>
  984. * <ul style="padding:5px;padding-left:26px;list-style-type:circle;">
  985. * <li><b>color, size</b> - same options as described above.</li>
  986. * <li><b>length</b> - the length of each tick in pixels extending from the axis.</li>
  987. * <li><b>display</b> - how the ticks are drawn. Possible values are "none", "inside", "outside", and "cross".</li>
  988. * </ul></li></li>
  989. * </ul>
  990. */
  991. extraStyle: null,
  992. /**
  993. * @cfg {Object} seriesStyles
  994. * Contains styles to apply to the series after a refresh. Defaults to <tt>null</tt>.
  995. */
  996. seriesStyles: null,
  997. /**
  998. * @cfg {Boolean} disableCaching
  999. * True to add a "cache buster" to the end of the chart url. Defaults to true for Opera and IE.
  1000. */
  1001. disableCaching: Ext.isIE || Ext.isOpera,
  1002. disableCacheParam: '_dc',
  1003. initComponent : function(){
  1004. Ext.chart.Chart.superclass.initComponent.call(this);
  1005. if(!this.url){
  1006. this.url = Ext.chart.Chart.CHART_URL;
  1007. }
  1008. if(this.disableCaching){
  1009. this.url = Ext.urlAppend(this.url, String.format('{0}={1}', this.disableCacheParam, new Date().getTime()));
  1010. }
  1011. this.addEvents(
  1012. 'itemmouseover',
  1013. 'itemmouseout',
  1014. 'itemclick',
  1015. 'itemdoubleclick',
  1016. 'itemdragstart',
  1017. 'itemdrag',
  1018. 'itemdragend',
  1019. /**
  1020. * @event beforerefresh
  1021. * Fires before a refresh to the chart data is called. If the beforerefresh handler returns
  1022. * <tt>false</tt> the {@link #refresh} action will be cancelled.
  1023. * @param {Chart} this
  1024. */
  1025. 'beforerefresh',
  1026. /**
  1027. * @event refresh
  1028. * Fires after the chart data has been refreshed.
  1029. * @param {Chart} this
  1030. */
  1031. 'refresh'
  1032. );
  1033. this.store = Ext.StoreMgr.lookup(this.store);
  1034. },
  1035. /**
  1036. * Sets a single style value on the Chart instance.
  1037. *
  1038. * @param name {String} Name of the Chart style value to change.
  1039. * @param value {Object} New value to pass to the Chart style.
  1040. */
  1041. setStyle: function(name, value){
  1042. this.swf.setStyle(name, Ext.encode(value));
  1043. },
  1044. /**
  1045. * Resets all styles on the Chart instance.
  1046. *
  1047. * @param styles {Object} Initializer for all Chart styles.
  1048. */
  1049. setStyles: function(styles){
  1050. this.swf.setStyles(Ext.encode(styles));
  1051. },
  1052. /**
  1053. * Sets the styles on all series in the Chart.
  1054. *
  1055. * @param styles {Array} Initializer for all Chart series styles.
  1056. */
  1057. setSeriesStyles: function(styles){
  1058. this.seriesStyles = styles;
  1059. var s = [];
  1060. Ext.each(styles, function(style){
  1061. s.push(Ext.encode(style));
  1062. });
  1063. this.swf.setSeriesStyles(s);
  1064. },
  1065. setCategoryNames : function(names){
  1066. this.swf.setCategoryNames(names);
  1067. },
  1068. setLegendRenderer : function(fn, scope){
  1069. var chart = this;
  1070. scope = scope || chart;
  1071. chart.removeFnProxy(chart.legendFnName);
  1072. chart.legendFnName = chart.createFnProxy(function(name){
  1073. return fn.call(scope, name);
  1074. });
  1075. chart.swf.setLegendLabelFunction(chart.legendFnName);
  1076. },
  1077. setTipRenderer : function(fn, scope){
  1078. var chart = this;
  1079. scope = scope || chart;
  1080. chart.removeFnProxy(chart.tipFnName);
  1081. chart.tipFnName = chart.createFnProxy(function(item, index, series){
  1082. var record = chart.store.getAt(index);
  1083. return fn.call(scope, chart, record, index, series);
  1084. });
  1085. chart.swf.setDataTipFunction(chart.tipFnName);
  1086. },
  1087. setSeries : function(series){
  1088. this.series = series;
  1089. this.refresh();
  1090. },
  1091. /**
  1092. * Changes the data store bound to this chart and refreshes it.
  1093. * @param {Store} store The store to bind to this chart
  1094. */
  1095. bindStore : function(store, initial){
  1096. if(!initial && this.store){
  1097. if(store !== this.store && this.store.autoDestroy){
  1098. this.store.destroy();
  1099. }else{
  1100. this.store.un("datachanged", this.refresh, this);
  1101. this.store.un("add", this.delayRefresh, this);
  1102. this.store.un("remove", this.delayRefresh, this);
  1103. this.store.un("update", this.delayRefresh, this);
  1104. this.store.un("clear", this.refresh, this);
  1105. }
  1106. }
  1107. if(store){
  1108. store = Ext.StoreMgr.lookup(store);
  1109. store.on({
  1110. scope: this,
  1111. datachanged: this.refresh,
  1112. add: this.delayRefresh,
  1113. remove: this.delayRefresh,
  1114. update: this.delayRefresh,
  1115. clear: this.refresh
  1116. });
  1117. }
  1118. this.store = store;
  1119. if(store && !initial){
  1120. this.refresh();
  1121. }
  1122. },
  1123. onSwfReady : function(isReset){
  1124. Ext.chart.Chart.superclass.onSwfReady.call(this, isReset);
  1125. var ref;
  1126. this.swf.setType(this.type);
  1127. if(this.chartStyle){
  1128. this.setStyles(Ext.apply({}, this.extraStyle, this.chartStyle));
  1129. }
  1130. if(this.categoryNames){
  1131. this.setCategoryNames(this.categoryNames);
  1132. }
  1133. if(this.tipRenderer){
  1134. ref = this.getFunctionRef(this.tipRenderer);
  1135. this.setTipRenderer(ref.fn, ref.scope);
  1136. }
  1137. if(this.legendRenderer){
  1138. ref = this.getFunctionRef(this.legendRenderer);
  1139. this.setLegendRenderer(ref.fn, ref.scope);
  1140. }
  1141. if(!isReset){
  1142. this.bindStore(this.store, true);
  1143. }
  1144. this.refresh.defer(10, this);
  1145. },
  1146. delayRefresh : function(){
  1147. if(!this.refreshTask){
  1148. this.refreshTask = new Ext.util.DelayedTask(this.refresh, this);
  1149. }
  1150. this.refreshTask.delay(this.refreshBuffer);
  1151. },
  1152. refresh : function(){
  1153. if(this.fireEvent('beforerefresh', this) !== false){
  1154. var styleChanged = false;
  1155. // convert the store data into something YUI charts can understand
  1156. var data = [], rs = this.store.data.items;
  1157. for(var j = 0, len = rs.length; j < len; j++){
  1158. data[j] = rs[j].data;
  1159. }
  1160. //make a copy of the series definitions so that we aren't
  1161. //editing them directly.
  1162. var dataProvider = [];
  1163. var seriesCount = 0;
  1164. var currentSeries = null;
  1165. var i = 0;
  1166. if(this.series){
  1167. seriesCount = this.series.length;
  1168. for(i = 0; i < seriesCount; i++){
  1169. currentSeries = this.series[i];
  1170. var clonedSeries = {};
  1171. for(var prop in currentSeries){
  1172. if(prop == "style" && currentSeries.style !== null){
  1173. clonedSeries.style = Ext.encode(currentSeries.style);
  1174. styleChanged = true;
  1175. //we don't want to modify the styles again next time
  1176. //so null out the style property.
  1177. // this causes issues
  1178. // currentSeries.style = null;
  1179. } else{
  1180. clonedSeries[prop] = currentSeries[prop];
  1181. }
  1182. }
  1183. dataProvider.push(clonedSeries);
  1184. }
  1185. }
  1186. if(seriesCount > 0){
  1187. for(i = 0; i < seriesCount; i++){
  1188. currentSeries = dataProvider[i];
  1189. if(!currentSeries.type){
  1190. currentSeries.type = this.type;
  1191. }
  1192. currentSeries.dataProvider = data;
  1193. }
  1194. } else{
  1195. dataProvider.push({type: this.type, dataProvider: data});
  1196. }
  1197. this.swf.setDataProvider(dataProvider);
  1198. if(this.seriesStyles){
  1199. this.setSeriesStyles(this.seriesStyles);
  1200. }
  1201. this.fireEvent('refresh', this);
  1202. }
  1203. },
  1204. // private
  1205. createFnProxy : function(fn){
  1206. var fnName = 'extFnProxy' + (++Ext.chart.Chart.PROXY_FN_ID);
  1207. Ext.chart.Chart.proxyFunction[fnName] = fn;
  1208. return 'Ext.chart.Chart.proxyFunction.' + fnName;
  1209. },
  1210. // private
  1211. removeFnProxy : function(fn){
  1212. if(!Ext.isEmpty(fn)){
  1213. fn = fn.replace('Ext.chart.Chart.proxyFunction.', '');
  1214. delete Ext.chart.Chart.proxyFunction[fn];
  1215. }
  1216. },
  1217. // private
  1218. getFunctionRef : function(val){
  1219. if(Ext.isFunction(val)){
  1220. return {
  1221. fn: val,
  1222. scope: this
  1223. };
  1224. }else{
  1225. return {
  1226. fn: val.fn,
  1227. scope: val.scope || this
  1228. };
  1229. }
  1230. },
  1231. // private
  1232. onDestroy: function(){
  1233. if (this.refreshTask && this.refreshTask.cancel){
  1234. this.refreshTask.cancel();
  1235. }
  1236. Ext.chart.Chart.superclass.onDestroy.call(this);
  1237. this.bindStore(null);
  1238. this.removeFnProxy(this.tipFnName);
  1239. this.removeFnProxy(this.legendFnName);
  1240. }
  1241. });
  1242. Ext.reg('chart', Ext.chart.Chart);
  1243. Ext.chart.Chart.PROXY_FN_ID = 0;
  1244. Ext.chart.Chart.proxyFunction = {};
  1245. /**
  1246. * Sets the url to load the chart from. This should be set to a local resource.
  1247. * @static
  1248. * @type String
  1249. */
  1250. Ext.chart.Chart.CHART_URL = 'http:/' + '/yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf';
  1251. /**
  1252. * @class Ext.chart.PieChart
  1253. * @extends Ext.chart.Chart
  1254. * @constructor
  1255. * @xtype piechart
  1256. */
  1257. Ext.chart.PieChart = Ext.extend(Ext.chart.Chart, {
  1258. type: 'pie',
  1259. onSwfReady : function(isReset){
  1260. Ext.chart.PieChart.superclass.onSwfReady.call(this, isReset);
  1261. this.setDataField(this.dataField);
  1262. this.setCategoryField(this.categoryField);
  1263. },
  1264. setDataField : function(field){
  1265. this.dataField = field;
  1266. this.swf.setDataField(field);
  1267. },
  1268. setCategoryField : function(field){
  1269. this.categoryField = field;
  1270. this.swf.setCategoryField(field);
  1271. }
  1272. });
  1273. Ext.reg('piechart', Ext.chart.PieChart);
  1274. /**
  1275. * @class Ext.chart.CartesianChart
  1276. * @extends Ext.chart.Chart
  1277. * @constructor
  1278. * @xtype cartesianchart
  1279. */
  1280. Ext.chart.CartesianChart = Ext.extend(Ext.chart.Chart, {
  1281. onSwfReady : function(isReset){
  1282. Ext.chart.CartesianChart.superclass.onSwfReady.call(this, isReset);
  1283. this.labelFn = [];
  1284. if(this.xField){
  1285. this.setXField(this.xField);
  1286. }
  1287. if(this.yField){
  1288. this.setYField(this.yField);
  1289. }
  1290. if(this.xAxis){
  1291. this.setXAxis(this.xAxis);
  1292. }
  1293. if(this.xAxes){
  1294. this.setXAxes(this.xAxes);
  1295. }
  1296. if(this.yAxis){
  1297. this.setYAxis(this.yAxis);
  1298. }
  1299. if(this.yAxes){
  1300. this.setYAxes(this.yAxes);
  1301. }
  1302. if(Ext.isDefined(this.constrainViewport)){
  1303. this.swf.setConstrainViewport(this.constrainViewport);
  1304. }
  1305. },
  1306. setXField : function(value){
  1307. this.xField = value;
  1308. this.swf.setHorizontalField(value);
  1309. },
  1310. setYField : function(value){
  1311. this.yField = value;
  1312. this.swf.setVerticalField(value);
  1313. },
  1314. setXAxis : function(value){
  1315. this.xAxis = this.createAxis('xAxis', value);
  1316. this.swf.setHorizontalAxis(this.xAxis);
  1317. },
  1318. setXAxes : function(value){
  1319. var axis;
  1320. for(var i = 0; i < value.length; i++) {
  1321. axis = this.createAxis('xAxis' + i, value[i]);
  1322. this.swf.setHorizontalAxis(axis);
  1323. }
  1324. },
  1325. setYAxis : function(value){
  1326. this.yAxis = this.createAxis('yAxis', value);
  1327. this.swf.setVerticalAxis(this.yAxis);
  1328. },
  1329. setYAxes : function(value){
  1330. var axis;
  1331. for(var i = 0; i < value.length; i++) {
  1332. axis = this.createAxis('yAxis' + i, value[i]);
  1333. this.swf.setVerticalAxis(axis);
  1334. }
  1335. },
  1336. createAxis : function(axis, value){
  1337. var o = Ext.apply({}, value),
  1338. ref,
  1339. old;
  1340. if(this[axis]){
  1341. old = this[axis].labelFunction;
  1342. this.removeFnProxy(old);
  1343. this.labelFn.remove(old);
  1344. }
  1345. if(o.labelRenderer){
  1346. ref = this.getFunctionRef(o.labelRenderer);
  1347. o.labelFunction = this.createFnProxy(function(v){
  1348. return ref.fn.call(ref.scope, v);
  1349. });
  1350. delete o.labelRenderer;
  1351. this.labelFn.push(o.labelFunction);
  1352. }
  1353. if(axis.indexOf('xAxis') > -1 && o.position == 'left'){
  1354. o.position = 'bottom';
  1355. }
  1356. return o;
  1357. },
  1358. onDestroy : function(){
  1359. Ext.chart.CartesianChart.superclass.onDestroy.call(this);
  1360. Ext.each(this.labelFn, function(fn){
  1361. this.removeFnProxy(fn);
  1362. }, this);
  1363. }
  1364. });
  1365. Ext.reg('cartesianchart', Ext.chart.CartesianChart);
  1366. /**
  1367. * @class Ext.chart.LineChart
  1368. * @extends Ext.chart.CartesianChart
  1369. * @constructor
  1370. * @xtype linechart
  1371. */
  1372. Ext.chart.LineChart = Ext.extend(Ext.chart.CartesianChart, {
  1373. type: 'line'
  1374. });
  1375. Ext.reg('linechart', Ext.chart.LineChart);
  1376. /**
  1377. * @class Ext.chart.ColumnChart
  1378. * @extends Ext.chart.CartesianChart
  1379. * @constructor
  1380. * @xtype columnchart
  1381. */
  1382. Ext.chart.ColumnChart = Ext.extend(Ext.chart.CartesianChart, {
  1383. type: 'column'
  1384. });
  1385. Ext.reg('columnchart', Ext.chart.ColumnChart);
  1386. /**
  1387. * @class Ext.chart.StackedColumnChart
  1388. * @extends Ext.chart.CartesianChart
  1389. * @constructor
  1390. * @xtype stackedcolumnchart
  1391. */
  1392. Ext.chart.StackedColumnChart = Ext.extend(Ext.chart.CartesianChart, {
  1393. type: 'stackcolumn'
  1394. });
  1395. Ext.reg('stackedcolumnchart', Ext.chart.StackedColumnChart);
  1396. /**
  1397. * @class Ext.chart.BarChart
  1398. * @extends Ext.chart.CartesianChart
  1399. * @constructor
  1400. * @xtype barchart
  1401. */
  1402. Ext.chart.BarChart = Ext.extend(Ext.chart.CartesianChart, {
  1403. type: 'bar'
  1404. });
  1405. Ext.reg('barchart', Ext.chart.BarChart);
  1406. /**
  1407. * @class Ext.chart.StackedBarChart
  1408. * @extends Ext.chart.CartesianChart
  1409. * @constructor
  1410. * @xtype stackedbarchart
  1411. */
  1412. Ext.chart.StackedBarChart = Ext.extend(Ext.chart.CartesianChart, {
  1413. type: 'stackbar'
  1414. });
  1415. Ext.reg('stackedbarchart', Ext.chart.StackedBarChart);
  1416. /**
  1417. * @class Ext.chart.Axis
  1418. * Defines a CartesianChart's vertical or horizontal axis.
  1419. * @constructor
  1420. */
  1421. Ext.chart.Axis = function(config){
  1422. Ext.apply(this, config);
  1423. };
  1424. Ext.chart.Axis.prototype =
  1425. {
  1426. /**
  1427. * The type of axis.
  1428. *
  1429. * @property type
  1430. * @type String
  1431. */
  1432. type: null,
  1433. /**
  1434. * The direction in which the axis is drawn. May be "horizontal" or "vertical".
  1435. *
  1436. * @property orientation
  1437. * @type String
  1438. */
  1439. orientation: "horizontal",
  1440. /**
  1441. * If true, the items on the axis will be drawn in opposite direction.
  1442. *
  1443. * @property reverse
  1444. * @type Boolean
  1445. */
  1446. reverse: false,
  1447. /**
  1448. * A string reference to the globally-accessible function that may be called to
  1449. * determine each of the label values for this axis.
  1450. *
  1451. * @property labelFunction
  1452. * @type String
  1453. */
  1454. labelFunction: null,
  1455. /**
  1456. * If true, labels that overlap previously drawn labels on the axis will be hidden.
  1457. *
  1458. * @property hideOverlappingLabels
  1459. * @type Boolean
  1460. */
  1461. hideOverlappingLabels: true,
  1462. /**
  1463. * The space, in pixels, between labels on an axis.
  1464. *
  1465. * @property labelSpacing
  1466. * @type Number
  1467. */
  1468. labelSpacing: 2
  1469. };
  1470. /**
  1471. * @class Ext.chart.NumericAxis
  1472. * @extends Ext.chart.Axis
  1473. * A type of axis whose units are measured in numeric values.
  1474. * @constructor
  1475. */
  1476. Ext.chart.NumericAxis = Ext.extend(Ext.chart.Axis, {
  1477. type: "numeric",
  1478. /**
  1479. * The minimum value drawn by the axis. If not set explicitly, the axis
  1480. * minimum will be calculated automatically.
  1481. *
  1482. * @property minimum
  1483. * @type Number
  1484. */
  1485. minimum: NaN,
  1486. /**
  1487. * The maximum value drawn by the axis. If not set explicitly, the axis
  1488. * maximum will be calculated automatically.
  1489. *
  1490. * @property maximum
  1491. * @type Number
  1492. */
  1493. maximum: NaN,
  1494. /**
  1495. * The spacing between major intervals on this axis.
  1496. *
  1497. * @property majorUnit
  1498. * @type Number
  1499. */
  1500. majorUnit: NaN,
  1501. /**
  1502. * The spacing between minor intervals on this axis.
  1503. *
  1504. * @property minorUnit
  1505. * @type Number
  1506. */
  1507. minorUnit: NaN,
  1508. /**
  1509. * If true, the labels, ticks, gridlines, and other objects will snap to the
  1510. * nearest major or minor unit. If false, their position will be based on
  1511. * the minimum value.
  1512. *
  1513. * @property snapToUnits
  1514. * @type Boolean
  1515. */
  1516. snapToUnits: true,
  1517. /**
  1518. * If true, and the bounds are calculated automatically, either the minimum
  1519. * or maximum will be set to zero.
  1520. *
  1521. * @property alwaysShowZero
  1522. * @type Boolean
  1523. */
  1524. alwaysShowZero: true,
  1525. /**
  1526. * The scaling algorithm to use on this axis. May be "linear" or
  1527. * "logarithmic".
  1528. *
  1529. * @property scale
  1530. * @type String
  1531. */
  1532. scale: "linear",
  1533. /**
  1534. * Indicates whether to round the major unit.
  1535. *
  1536. * @property roundMajorUnit
  1537. * @type Boolean
  1538. */
  1539. roundMajorUnit: true,
  1540. /**
  1541. * Indicates whether to factor in the size of the labels when calculating a
  1542. * major unit.
  1543. *
  1544. * @property calculateByLabelSize
  1545. * @type Boolean
  1546. */
  1547. calculateByLabelSize: true,
  1548. /**
  1549. * Indicates the position of the axis relative to the chart
  1550. *
  1551. * @property position
  1552. * @type String
  1553. */
  1554. position: 'left',
  1555. /**
  1556. * Indicates whether to extend maximum beyond data's maximum to the nearest
  1557. * majorUnit.
  1558. *
  1559. * @property adjustMaximumByMajorUnit
  1560. * @type Boolean
  1561. */
  1562. adjustMaximumByMajorUnit: true,
  1563. /**
  1564. * Indicates whether to extend the minimum beyond data's minimum to the
  1565. * nearest majorUnit.
  1566. *
  1567. * @property adjustMinimumByMajorUnit
  1568. * @type Boolean
  1569. */
  1570. adjustMinimumByMajorUnit: true
  1571. });
  1572. /**
  1573. * @class Ext.chart.TimeAxis
  1574. * @extends Ext.chart.Axis
  1575. * A type of axis whose units are measured in time-based values.
  1576. * @constructor
  1577. */
  1578. Ext.chart.TimeAxis = Ext.extend(Ext.chart.Axis, {
  1579. type: "time",
  1580. /**
  1581. * The minimum value drawn by the axis. If not set explicitly, the axis
  1582. * minimum will be calculated automatically.
  1583. *
  1584. * @property minimum
  1585. * @type Date
  1586. */
  1587. minimum: null,
  1588. /**
  1589. * The maximum value drawn by the axis. If not set explicitly, the axis
  1590. * maximum will be calculated automatically.
  1591. *
  1592. * @property maximum
  1593. * @type Number
  1594. */
  1595. maximum: null,
  1596. /**
  1597. * The spacing between major intervals on this axis.
  1598. *
  1599. * @property majorUnit
  1600. * @type Number
  1601. */
  1602. majorUnit: NaN,
  1603. /**
  1604. * The time unit used by the majorUnit.
  1605. *
  1606. * @property majorTimeUnit
  1607. * @type String
  1608. */
  1609. majorTimeUnit: null,
  1610. /**
  1611. * The spacing between minor intervals on this axis.
  1612. *
  1613. * @property minorUnit
  1614. * @type Number
  1615. */
  1616. minorUnit: NaN,
  1617. /**
  1618. * The time unit used by the minorUnit.
  1619. *
  1620. * @property minorTimeUnit
  1621. * @type String
  1622. */
  1623. minorTimeUnit: null,
  1624. /**
  1625. * If true, the labels, ticks, gridlines, and other objects will snap to the
  1626. * nearest major or minor unit. If false, their position will be based on
  1627. * the minimum value.
  1628. *
  1629. * @property snapToUnits
  1630. * @type Boolean
  1631. */
  1632. snapToUnits: true,
  1633. /**
  1634. * Series that are stackable will only stack when this value is set to true.
  1635. *
  1636. * @property stackingEnabled
  1637. * @type Boolean
  1638. */
  1639. stackingEnabled: false,
  1640. /**
  1641. * Indicates whether to factor in the size of the labels when calculating a
  1642. * major unit.
  1643. *
  1644. * @property calculateByLabelSize
  1645. * @type Boolean
  1646. */
  1647. calculateByLabelSize: true
  1648. });
  1649. /**
  1650. * @class Ext.chart.CategoryAxis
  1651. * @extends Ext.chart.Axis
  1652. * A type of axis that displays items in categories.
  1653. * @constructor
  1654. */
  1655. Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, {
  1656. type: "category",
  1657. /**
  1658. * A list of category names to display along this axis.
  1659. *
  1660. * @property categoryNames
  1661. * @type Array
  1662. */
  1663. categoryNames: null,
  1664. /**
  1665. * Indicates whether or not to calculate the number of categories (ticks and
  1666. * labels) when there is not enough room to display all labels on the axis.
  1667. * If set to true, the axis will determine the number of categories to plot.
  1668. * If not, all categories will be plotted.
  1669. *
  1670. * @property calculateCategoryCount
  1671. * @type Boolean
  1672. */
  1673. calculateCategoryCount: false
  1674. });
  1675. /**
  1676. * @class Ext.chart.Series
  1677. * Series class for the charts widget.
  1678. * @constructor
  1679. */
  1680. Ext.chart.Series = function(config) { Ext.apply(this, config); };
  1681. Ext.chart.Series.prototype =
  1682. {
  1683. /**
  1684. * The type of series.
  1685. *
  1686. * @property type
  1687. * @type String
  1688. */
  1689. type: null,
  1690. /**
  1691. * The human-readable name of the series.
  1692. *
  1693. * @property displayName
  1694. * @type String
  1695. */
  1696. displayName: null
  1697. };
  1698. /**
  1699. * @class Ext.chart.CartesianSeries
  1700. * @extends Ext.chart.Series
  1701. * CartesianSeries class for the charts widget.
  1702. * @constructor
  1703. */
  1704. Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, {
  1705. /**
  1706. * The field used to access the x-axis value from the items from the data
  1707. * source.
  1708. *
  1709. * @property xField
  1710. * @type String
  1711. */
  1712. xField: null,
  1713. /**
  1714. * The field used to access the y-axis value from the items from the data
  1715. * source.
  1716. *
  1717. * @property yField
  1718. * @type String
  1719. */
  1720. yField: null,
  1721. /**
  1722. * False to not show this series in the legend. Defaults to <tt>true</tt>.
  1723. *
  1724. * @property showInLegend
  1725. * @type Boolean
  1726. */
  1727. showInLegend: true,
  1728. /**
  1729. * Indicates which axis the series will bind to
  1730. *
  1731. * @property axis
  1732. * @type String
  1733. */
  1734. axis: 'primary'
  1735. });
  1736. /**
  1737. * @class Ext.chart.ColumnSeries
  1738. * @extends Ext.chart.CartesianSeries
  1739. * ColumnSeries class for the charts widget.
  1740. * @constructor
  1741. */
  1742. Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, {
  1743. type: "column"
  1744. });
  1745. /**
  1746. * @class Ext.chart.LineSeries
  1747. * @extends Ext.chart.CartesianSeries
  1748. * LineSeries class for the charts widget.
  1749. * @constructor
  1750. */
  1751. Ext.chart.LineSeries = Ext.extend(Ext.chart.CartesianSeries, {
  1752. type: "line"
  1753. });
  1754. /**
  1755. * @class Ext.chart.BarSeries
  1756. * @extends Ext.chart.CartesianSeries
  1757. * BarSeries class for the charts widget.
  1758. * @constructor
  1759. */
  1760. Ext.chart.BarSeries = Ext.extend(Ext.chart.CartesianSeries, {
  1761. type: "bar"
  1762. });
  1763. /**
  1764. * @class Ext.chart.PieSeries
  1765. * @extends Ext.chart.Series
  1766. * PieSeries class for the charts widget.
  1767. * @constructor
  1768. */
  1769. Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, {
  1770. type: "pie",
  1771. dataField: null,
  1772. categoryField: null
  1773. });