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.

1926 lines
65 KiB

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