Browse Source

update

master
guy 7 years ago
parent
commit
4554c2b0b0
  1. 2596
      dist/base.js
  2. 4822
      dist/bundle.js
  3. 20
      dist/bundle.min.js
  4. 918
      dist/case.js
  5. 1327
      dist/chart.js
  6. 4
      dist/core.js
  7. 27
      dist/polyfill.js
  8. 104
      dist/router.js
  9. 1202
      dist/widget.js
  10. 8
      src/addons/chart/chart.combine.js
  11. 6
      src/addons/chart/chart.js
  12. 50
      src/addons/chart/chart/chart.abstract.js
  13. 22
      src/addons/chart/chart/chart.accumulatearea.js
  14. 28
      src/addons/chart/chart/chart.accumulateaxis.js
  15. 32
      src/addons/chart/chart/chart.accumulatebar.js
  16. 16
      src/addons/chart/chart/chart.accumulateradar.js
  17. 28
      src/addons/chart/chart/chart.area.js
  18. 28
      src/addons/chart/chart/chart.axis.js
  19. 30
      src/addons/chart/chart/chart.bar.js
  20. 63
      src/addons/chart/chart/chart.bubble.js
  21. 28
      src/addons/chart/chart/chart.comparearea.js
  22. 30
      src/addons/chart/chart/chart.compareaxis.js
  23. 30
      src/addons/chart/chart/chart.comparebar.js
  24. 74
      src/addons/chart/chart/chart.dashboard.js
  25. 8
      src/addons/chart/chart/chart.donut.js
  26. 40
      src/addons/chart/chart/chart.fallaxis.js
  27. 10
      src/addons/chart/chart/chart.forcebubble.js
  28. 20
      src/addons/chart/chart/chart.gismap.js
  29. 28
      src/addons/chart/chart/chart.line.js
  30. 52
      src/addons/chart/chart/chart.map.js
  31. 54
      src/addons/chart/chart/chart.multiaxis.js
  32. 54
      src/addons/chart/chart/chart.multiaxiscombine.js
  33. 28
      src/addons/chart/chart/chart.percentaccumulatearea.js
  34. 26
      src/addons/chart/chart/chart.percentaccumulateaxis.js
  35. 14
      src/addons/chart/chart/chart.pie.js
  36. 16
      src/addons/chart/chart/chart.radar.js
  37. 28
      src/addons/chart/chart/chart.rangearea.js
  38. 56
      src/addons/chart/chart/chart.scatter.js
  39. 366
      src/addons/chart/factory.charts.js
  40. 6
      src/base/canvas/canvas.js
  41. 10
      src/base/collection/collection.js
  42. 20
      src/base/combination/combo.js
  43. 10
      src/base/combination/expander.js
  44. 18
      src/base/combination/group.button.js
  45. 8
      src/base/combination/group.combo.js
  46. 6
      src/base/combination/group.virtual.js
  47. 8
      src/base/combination/loader.js
  48. 2
      src/base/combination/navigation.js
  49. 10
      src/base/combination/searcher.js
  50. 12
      src/base/combination/switcher.js
  51. 4
      src/base/combination/tab.js
  52. 2
      src/base/combination/tree.button.js
  53. 4
      src/base/el.js
  54. 1228
      src/base/formula/codemirror/codemirror.js
  55. 2
      src/base/formula/codemirror/formula-hint.js
  56. 10
      src/base/formula/codemirror/formula-mode.js
  57. 55
      src/base/formula/codemirror/show-hint.js
  58. 2
      src/base/formula/config.js
  59. 14
      src/base/formula/formulaeditor.js
  60. 54
      src/base/foundation/message.js
  61. 16
      src/base/grid/grid.js
  62. 22
      src/base/layer/layer.floatbox.js
  63. 18
      src/base/layer/layer.popup.js
  64. 2
      src/base/layer/layer.searcher.js
  65. 4
      src/base/list/listview.js
  66. 4
      src/base/list/virtuallist.js
  67. 16
      src/base/pager/pager.js
  68. 6
      src/base/pane.js
  69. 2
      src/base/single/a/a.js
  70. 16
      src/base/single/bar/bar.loading.js
  71. 2
      src/base/single/button/button.basic.js
  72. 4
      src/base/single/button/button.node.js
  73. 10
      src/base/single/button/buttons/button.icon.js
  74. 6
      src/base/single/button/buttons/button.image.js
  75. 10
      src/base/single/button/buttons/button.js
  76. 2
      src/base/single/button/buttons/button.text.js
  77. 4
      src/base/single/button/listitem/blankiconicontextitem.js
  78. 8
      src/base/single/button/listitem/blankicontexticonitem.js
  79. 6
      src/base/single/button/listitem/blankicontextitem.js
  80. 10
      src/base/single/button/listitem/icontexticonitem.js
  81. 2
      src/base/single/button/listitem/icontextitem.js
  82. 2
      src/base/single/button/listitem/texticonitem.js
  83. 2
      src/base/single/button/listitem/textitem.js
  84. 10
      src/base/single/button/node/icontexticonnode.js
  85. 6
      src/base/single/button/node/icontextnode.js
  86. 4
      src/base/single/button/node/texticonnode.js
  87. 2
      src/base/single/button/node/textnode.js
  88. 14
      src/base/single/editor/editor.code.js
  89. 14
      src/base/single/editor/editor.js
  90. 2
      src/base/single/editor/editor.multifile.js
  91. 12
      src/base/single/editor/editor.textarea.js
  92. 2
      src/base/single/icon/icon.js
  93. 6
      src/base/single/iframe/iframe.js
  94. 2
      src/base/single/img/img.js
  95. 2
      src/base/single/input/checkbox.js
  96. 2
      src/base/single/input/input.js
  97. 2
      src/base/single/input/radio.js
  98. 10
      src/base/single/label/label.js
  99. 2
      src/base/single/link/link.js
  100. 2
      src/base/single/single.js
  101. Some files were not shown because too many files have changed in this diff Show More

2596
dist/base.js vendored

File diff suppressed because one or more lines are too long

4822
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

20
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

918
dist/case.js vendored

File diff suppressed because it is too large Load Diff

1327
dist/chart.js vendored

File diff suppressed because it is too large Load Diff

4
dist/core.js vendored

@ -25715,7 +25715,7 @@ Data.Constant = BICst = {};
* 缓冲池 * 缓冲池
* @type {{Buffer: {}}} * @type {{Buffer: {}}}
*/ */
;
(function () { (function () {
var Buffer = {}; var Buffer = {};
var MODE = false;// 设置缓存模式为关闭 var MODE = false;// 设置缓存模式为关闭
@ -25736,7 +25736,7 @@ Data.Constant = BICst = {};
* 共享池 * 共享池
* @type {{Shared: {}}} * @type {{Shared: {}}}
*/ */
;
(function () { (function () {
var _Shared = {}; var _Shared = {};
Data.SharingPool = { Data.SharingPool = {

27
dist/polyfill.js vendored

@ -8,7 +8,7 @@ if (!Array.prototype.indexOf) {
// 1. Let o be the result of calling ToObject passing // 1. Let o be the result of calling ToObject passing
// the this value as the argument. // the this value as the argument.
if (this == null) { if (this == null) {
throw new TypeError('"this" is null or not defined'); throw new TypeError("\"this\" is null or not defined");
} }
var o = Object(this); var o = Object(this);
@ -61,7 +61,7 @@ if (!Array.prototype.indexOf) {
} }
if (!Array.prototype.lastIndexOf) { if (!Array.prototype.lastIndexOf) {
Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) { Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) {
'use strict'; "use strict";
if (this === void 0 || this === null) { if (this === void 0 || this === null) {
throw new TypeError(); throw new TypeError();
@ -79,8 +79,7 @@ if (!Array.prototype.lastIndexOf) {
n = Number(arguments[1]); n = Number(arguments[1]);
if (n != n) { if (n != n) {
n = 0; n = 0;
} } else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) {
else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n)); n = (n > 0 || -1) * Math.floor(Math.abs(n));
} }
} }
@ -127,29 +126,29 @@ window.localStorage || (window.localStorage = {
clear: function () { clear: function () {
this.items = {}; this.items = {};
} }
});if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) { });if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else { } else {
Set = function () { Set = function () {
this.set = {} this.set = {};
}; };
Set.prototype.has = function (key) { Set.prototype.has = function (key) {
return this.set[key] !== undefined; return this.set[key] !== undefined;
}; };
Set.prototype.add = function (key) { Set.prototype.add = function (key) {
this.set[key] = 1 this.set[key] = 1;
}; };
Set.prototype.clear = function () { Set.prototype.clear = function () {
this.set = {} this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
;!function (window) { !function (window) {
var ua = window.navigator.userAgent.toLowerCase(), var ua = window.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
Array.prototype.sort = function (fn) { Array.prototype.sort = function (fn) {
if (!!fn && typeof fn === 'function') { if (!!fn && typeof fn === "function") {
if (this.length < 2) { if (this.length < 2) {
return this; return this;
} }
@ -157,8 +156,8 @@ window.localStorage || (window.localStorage = {
for (; i < l; i++) { for (; i < l; i++) {
for (j = i + 1; j < l; j++) { for (j = i + 1; j < l; j++) {
t = fn.call(this, this[i], this[j]); t = fn.call(this, this[i], this[j]);
r = (typeof t === 'number' ? t : r = (typeof t === "number" ? t :
!!t ? 1 : 0) > 0; t ? 1 : 0) > 0;
if (r === true) { if (r === true) {
tmp = this[i]; tmp = this[i];
this[i] = this[j]; this[i] = this[j];
@ -167,9 +166,9 @@ window.localStorage || (window.localStorage = {
} }
} }
return this; return this;
} else {
return _sort.call(this);
} }
return _sort.call(this);
}; };
} }
}(window); }(window);

104
dist/router.js vendored

@ -1,10 +1,10 @@
;(function(){ (function () {
var Events = { var Events = {
// Bind an event to a `callback` function. Passing `"all"` will bind // Bind an event to a `callback` function. Passing `"all"` will bind
// the callback to all events fired. // the callback to all events fired.
on: function (name, callback, context) { on: function (name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; if (!eventsApi(this, "on", name, [callback, context]) || !callback) return this;
this._events || (this._events = {}); this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []); var events = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this}); events.push({callback: callback, context: context, ctx: context || this});
@ -14,7 +14,7 @@
// Bind an event to only be triggered a single time. After the first time // Bind an event to only be triggered a single time. After the first time
// the callback is invoked, it will be removed. // the callback is invoked, it will be removed.
once: function (name, callback, context) { once: function (name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; if (!eventsApi(this, "once", name, [callback, context]) || !callback) return this;
var self = this; var self = this;
var once = _.once(function () { var once = _.once(function () {
self.off(name, once); self.off(name, once);
@ -29,7 +29,7 @@
// callbacks for the event. If `name` is null, removes all bound // callbacks for the event. If `name` is null, removes all bound
// callbacks for all events. // callbacks for all events.
off: function (name, callback, context) { off: function (name, callback, context) {
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!this._events || !eventsApi(this, "off", name, [callback, context])) return this;
// Remove all callbacks for all events. // Remove all callbacks for all events.
if (!name && !callback && !context) { if (!name && !callback && !context) {
@ -86,7 +86,7 @@
trigger: function (name) { trigger: function (name) {
if (!this._events) return this; if (!this._events) return this;
var args = slice.call(arguments, 1); var args = slice.call(arguments, 1);
if (!eventsApi(this, 'trigger', name, args)) return this; if (!eventsApi(this, "trigger", name, args)) return this;
var events = this._events[name]; var events = this._events[name];
var allEvents = this._events.all; var allEvents = this._events.all;
if (events) triggerEvents(events, args); if (events) triggerEvents(events, args);
@ -103,15 +103,15 @@
// listening to. // listening to.
listenTo: function (obj, name, callback) { listenTo: function (obj, name, callback) {
var listeningTo = this._listeningTo || (this._listeningTo = {}); var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = _.uniqueId('l')); var id = obj._listenId || (obj._listenId = _.uniqueId("l"));
listeningTo[id] = obj; listeningTo[id] = obj;
if (!callback && typeof name === 'object') callback = this; if (!callback && typeof name === "object") callback = this;
obj.on(name, callback, this); obj.on(name, callback, this);
return this; return this;
}, },
listenToOnce: function (obj, name, callback) { listenToOnce: function (obj, name, callback) {
if (typeof name === 'object') { if (typeof name === "object") {
for (var event in name) this.listenToOnce(obj, event, name[event]); for (var event in name) this.listenToOnce(obj, event, name[event]);
return this; return this;
} }
@ -137,7 +137,7 @@
var listeningTo = this._listeningTo; var listeningTo = this._listeningTo;
if (!listeningTo) return this; if (!listeningTo) return this;
var remove = !name && !callback; var remove = !name && !callback;
if (!callback && typeof name === 'object') callback = this; if (!callback && typeof name === "object") callback = this;
if (obj) (listeningTo = {})[obj._listenId] = obj; if (obj) (listeningTo = {})[obj._listenId] = obj;
for (var id in listeningTo) { for (var id in listeningTo) {
obj = listeningTo[id]; obj = listeningTo[id];
@ -159,7 +159,7 @@
if (!name) return true; if (!name) return true;
// Handle event maps. // Handle event maps.
if (typeof name === 'object') { if (typeof name === "object") {
for (var key in name) { for (var key in name) {
obj[action].apply(obj, [key, name[key]].concat(rest)); obj[action].apply(obj, [key, name[key]].concat(rest));
} }
@ -239,16 +239,16 @@
if (!_.isRegExp(route)) route = this._routeToRegExp(route); if (!_.isRegExp(route)) route = this._routeToRegExp(route);
if (_.isFunction(name)) { if (_.isFunction(name)) {
callback = name; callback = name;
name = ''; name = "";
} }
if (!callback) callback = this[name]; if (!callback) callback = this[name];
var router = this; var router = this;
BI.history.route(route, function (fragment) { BI.history.route(route, function (fragment) {
var args = router._extractParameters(route, fragment); var args = router._extractParameters(route, fragment);
if (router.execute(callback, args, name) !== false) { if (router.execute(callback, args, name) !== false) {
router.trigger.apply(router, ['route:' + name].concat(args)); router.trigger.apply(router, ["route:" + name].concat(args));
router.trigger('route', name, args); router.trigger("route", name, args);
BI.history.trigger('route', router, name, args); BI.history.trigger("route", router, name, args);
} }
}); });
return this; return this;
@ -271,7 +271,7 @@
// routes can be defined at the bottom of the route map. // routes can be defined at the bottom of the route map.
_bindRoutes: function () { _bindRoutes: function () {
if (!this.routes) return; if (!this.routes) return;
this.routes = _.result(this, 'routes'); this.routes = _.result(this, "routes");
var route, routes = _.keys(this.routes); var route, routes = _.keys(this.routes);
while ((route = routes.pop()) != null) { while ((route = routes.pop()) != null) {
this.route(route, this.routes[route]); this.route(route, this.routes[route]);
@ -281,13 +281,13 @@
// Convert a route string into a regular expression, suitable for matching // Convert a route string into a regular expression, suitable for matching
// against the current location hash. // against the current location hash.
_routeToRegExp: function (route) { _routeToRegExp: function (route) {
route = route.replace(escapeRegExp, '\\$&') route = route.replace(escapeRegExp, "\\$&")
.replace(optionalParam, '(?:$1)?') .replace(optionalParam, "(?:$1)?")
.replace(namedParam, function (match, optional) { .replace(namedParam, function (match, optional) {
return optional ? match : '([^/?]+)'; return optional ? match : "([^/?]+)";
}) })
.replace(splatParam, '([^?]*?)'); .replace(splatParam, "([^?]*?)");
return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); return new RegExp("^" + route + "(?:\\?([\\s\\S]*))?$");
}, },
// Given a route, and a URL fragment that it matches, return the array of // Given a route, and a URL fragment that it matches, return the array of
@ -314,10 +314,10 @@
// falls back to polling. // falls back to polling.
var History = function () { var History = function () {
this.handlers = []; this.handlers = [];
_.bindAll(this, 'checkUrl'); _.bindAll(this, "checkUrl");
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== 'undefined') { if (typeof window !== "undefined") {
this.location = window.location; this.location = window.location;
this.history = window.history; this.history = window.history;
} }
@ -344,22 +344,22 @@
// Are we at the app root? // Are we at the app root?
atRoot: function () { atRoot: function () {
var path = this.location.pathname.replace(/[^\/]$/, '$&/'); var path = this.location.pathname.replace(/[^\/]$/, "$&/");
return path === this.root && !this.getSearch(); return path === this.root && !this.getSearch();
}, },
// In IE6, the hash fragment and search params are incorrect if the // In IE6, the hash fragment and search params are incorrect if the
// fragment contains `?`. // fragment contains `?`.
getSearch: function () { getSearch: function () {
var match = this.location.href.replace(/#.*/, '').match(/\?.+/); var match = this.location.href.replace(/#.*/, "").match(/\?.+/);
return match ? match[0] : ''; return match ? match[0] : "";
}, },
// Gets the true hash value. Cannot use location.hash directly due to bug // Gets the true hash value. Cannot use location.hash directly due to bug
// in Firefox where location.hash will always be decoded. // in Firefox where location.hash will always be decoded.
getHash: function (window) { getHash: function (window) {
var match = (window || this).location.href.match(/#(.*)$/); var match = (window || this).location.href.match(/#(.*)$/);
return match ? match[1] : ''; return match ? match[1] : "";
}, },
// Get the pathname and search params, without the root. // Get the pathname and search params, without the root.
@ -367,7 +367,7 @@
var path = decodeURI(this.location.pathname + this.getSearch()); var path = decodeURI(this.location.pathname + this.getSearch());
var root = this.root.slice(0, -1); var root = this.root.slice(0, -1);
if (!path.indexOf(root)) path = path.slice(root.length); if (!path.indexOf(root)) path = path.slice(root.length);
return path.charAt(0) === '/' ? path.slice(1) : path; return path.charAt(0) === "/" ? path.slice(1) : path;
}, },
// Get the cross-browser normalized URL fragment from the path or hash. // Get the cross-browser normalized URL fragment from the path or hash.
@ -379,27 +379,27 @@
fragment = this.getHash(); fragment = this.getHash();
} }
} }
return fragment.replace(routeStripper, ''); return fragment.replace(routeStripper, "");
}, },
// Start the hash change handling, returning `true` if the current URL matches // Start the hash change handling, returning `true` if the current URL matches
// an existing route, and `false` otherwise. // an existing route, and `false` otherwise.
start: function (options) { start: function (options) {
if (History.started) throw new Error('BI.history has already been started'); if (History.started) throw new Error("BI.history has already been started");
History.started = true; History.started = true;
// Figure out the initial configuration. Do we need an iframe? // Figure out the initial configuration. Do we need an iframe?
// Is pushState desired ... is it available? // Is pushState desired ... is it available?
this.options = _.extend({root: '/'}, this.options, options); this.options = _.extend({root: "/"}, this.options, options);
this.root = this.options.root; this.root = this.options.root;
this._wantsHashChange = this.options.hashChange !== false; this._wantsHashChange = this.options.hashChange !== false;
this._hasHashChange = 'onhashchange' in window; this._hasHashChange = "onhashchange" in window;
this._wantsPushState = !!this.options.pushState; this._wantsPushState = !!this.options.pushState;
this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
this.fragment = this.getFragment(); this.fragment = this.getFragment();
// Normalize root to always include a leading and trailing slash. // Normalize root to always include a leading and trailing slash.
this.root = ('/' + this.root + '/').replace(rootStripper, '/'); this.root = ("/" + this.root + "/").replace(rootStripper, "/");
// Transition from hashChange to pushState or vice versa if both are // Transition from hashChange to pushState or vice versa if both are
// requested. // requested.
@ -408,8 +408,8 @@
// If we've started off with a route from a `pushState`-enabled // If we've started off with a route from a `pushState`-enabled
// browser, but we're currently in a browser that doesn't support it... // browser, but we're currently in a browser that doesn't support it...
if (!this._hasPushState && !this.atRoot()) { if (!this._hasPushState && !this.atRoot()) {
var root = this.root.slice(0, -1) || '/'; var root = this.root.slice(0, -1) || "/";
this.location.replace(root + '#' + this.getPath()); this.location.replace(root + "#" + this.getPath());
// Return immediately as browser will do redirect to new url // Return immediately as browser will do redirect to new url
return true; return true;
@ -425,28 +425,28 @@
// support the `hashchange` event, HTML5 history, or the user wants // support the `hashchange` event, HTML5 history, or the user wants
// `hashChange` but not `pushState`. // `hashChange` but not `pushState`.
if (!this._hasHashChange && this._wantsHashChange && (!this._wantsPushState || !this._hasPushState)) { if (!this._hasHashChange && this._wantsHashChange && (!this._wantsPushState || !this._hasPushState)) {
var iframe = document.createElement('iframe'); var iframe = document.createElement("iframe");
iframe.src = 'javascript:0'; iframe.src = "javascript:0";
iframe.style.display = 'none'; iframe.style.display = "none";
iframe.tabIndex = -1; iframe.tabIndex = -1;
var body = document.body; var body = document.body;
// Using `appendChild` will throw on IE < 9 if the document is not ready. // Using `appendChild` will throw on IE < 9 if the document is not ready.
this.iframe = body.insertBefore(iframe, body.firstChild).contentWindow; this.iframe = body.insertBefore(iframe, body.firstChild).contentWindow;
this.iframe.document.open().close(); this.iframe.document.open().close();
this.iframe.location.hash = '#' + this.fragment; this.iframe.location.hash = "#" + this.fragment;
} }
// Add a cross-platform `addEventListener` shim for older browsers. // Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) { var addEventListener = window.addEventListener || function (eventName, listener) {
return attachEvent('on' + eventName, listener); return attachEvent("on" + eventName, listener);
}; };
// Depending on whether we're using pushState or hashes, and whether // Depending on whether we're using pushState or hashes, and whether
// 'onhashchange' is supported, determine how we check the URL state. // 'onhashchange' is supported, determine how we check the URL state.
if (this._hasPushState) { if (this._hasPushState) {
addEventListener('popstate', this.checkUrl, false); addEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) { } else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
addEventListener('hashchange', this.checkUrl, false); addEventListener("hashchange", this.checkUrl, false);
} else if (this._wantsHashChange) { } else if (this._wantsHashChange) {
this._checkUrlInterval = setInterval(this.checkUrl, this.interval); this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
} }
@ -459,14 +459,14 @@
stop: function () { stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers. // Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) { var removeEventListener = window.removeEventListener || function (eventName, listener) {
return detachEvent('on' + eventName, listener); return detachEvent("on" + eventName, listener);
}; };
// Remove window listeners. // Remove window listeners.
if (this._hasPushState) { if (this._hasPushState) {
removeEventListener('popstate', this.checkUrl, false); removeEventListener("popstate", this.checkUrl, false);
} else if (this._wantsHashChange && this._hasHashChange && !this.iframe) { } else if (this._wantsHashChange && this._hasHashChange && !this.iframe) {
removeEventListener('hashchange', this.checkUrl, false); removeEventListener("hashchange", this.checkUrl, false);
} }
// Clean up the iframe if necessary. // Clean up the iframe if necessary.
@ -527,24 +527,24 @@
if (!options || options === true) options = {trigger: !!options}; if (!options || options === true) options = {trigger: !!options};
// Normalize the fragment. // Normalize the fragment.
fragment = this.getFragment(fragment || ''); fragment = this.getFragment(fragment || "");
// Don't include a trailing slash on the root. // Don't include a trailing slash on the root.
var root = this.root; var root = this.root;
if (fragment === '' || fragment.charAt(0) === '?') { if (fragment === "" || fragment.charAt(0) === "?") {
root = root.slice(0, -1) || '/'; root = root.slice(0, -1) || "/";
} }
var url = root + fragment; var url = root + fragment;
// Strip the hash and decode for matching. // Strip the hash and decode for matching.
fragment = decodeURI(fragment.replace(pathStripper, '')); fragment = decodeURI(fragment.replace(pathStripper, ""));
if (this.fragment === fragment) return; if (this.fragment === fragment) return;
this.fragment = fragment; this.fragment = fragment;
// If pushState is available, we use it to set the fragment as a real URL. // If pushState is available, we use it to set the fragment as a real URL.
if (this._hasPushState) { if (this._hasPushState) {
this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); this.history[options.replace ? "replaceState" : "pushState"]({}, document.title, url);
// If hash changes haven't been explicitly disabled, update the hash // If hash changes haven't been explicitly disabled, update the hash
// fragment to store history. // fragment to store history.
@ -570,11 +570,11 @@
// a new one to the browser history. // a new one to the browser history.
_updateHash: function (location, fragment, replace) { _updateHash: function (location, fragment, replace) {
if (replace) { if (replace) {
var href = location.href.replace(/(javascript:|#).*$/, ''); var href = location.href.replace(/(javascript:|#).*$/, "");
location.replace(href + '#' + fragment); location.replace(href + "#" + fragment);
} else { } else {
// Some browsers require that `hash` contains a leading #. // Some browsers require that `hash` contains a leading #.
location.hash = '#' + fragment; location.hash = "#" + fragment;
} }
} }

1202
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

8
src/addons/chart/chart.combine.js

@ -14,7 +14,7 @@ BI.CombineChart = BI.inherit(BI.Widget, {
types: [[], []], types: [[], []],
popupItemsGetter: BI.emptyFn, popupItemsGetter: BI.emptyFn,
formatConfig: BI.emptyFn formatConfig: BI.emptyFn
}) });
}, },
_init: function () { _init: function () {
@ -44,7 +44,7 @@ BI.CombineChart = BI.inherit(BI.Widget, {
if (BI.isArray(axisItems)) { if (BI.isArray(axisItems)) {
result = BI.concat(result, axisItems); result = BI.concat(result, axisItems);
} else { } else {
result.push(BI.extend(axisItems, {"yAxis": yAxisIndex})); result.push(BI.extend(axisItems, {yAxis: yAxisIndex}));
} }
}); });
if (BI.isNotEmptyArray(combineItems)) { if (BI.isNotEmptyArray(combineItems)) {
@ -93,7 +93,7 @@ BI.CombineChart = BI.inherit(BI.Widget, {
}, },
hgap: 10 hgap: 10
}, item) }, item)
} };
}) })
}) })
}, },
@ -153,4 +153,4 @@ BI.CombineChart = BI.inherit(BI.Widget, {
}); });
BI.CombineChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.CombineChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.CombineChart.EVENT_ITEM_CLICK = "EVENT_ITEM_CLICK"; BI.CombineChart.EVENT_ITEM_CLICK = "EVENT_ITEM_CLICK";
BI.shortcut('bi.combine_chart', BI.CombineChart); BI.shortcut("bi.combine_chart", BI.CombineChart);

6
src/addons/chart/chart.js

@ -8,7 +8,7 @@ BI.Chart = BI.inherit(BI.Pane, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Chart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Chart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-chart" baseCls: "bi-chart"
}) });
}, },
_init: function () { _init: function () {
@ -35,7 +35,7 @@ BI.Chart = BI.inherit(BI.Pane, {
}, },
magnify: function () { magnify: function () {
this.vanCharts.refreshRestore() this.vanCharts.refreshRestore();
}, },
populate: function (items, options) { populate: function (items, options) {
@ -52,4 +52,4 @@ BI.Chart = BI.inherit(BI.Pane, {
} }
}); });
BI.Chart.EVENT_CHANGE = "EVENT_CHANGE"; BI.Chart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.chart', BI.Chart); BI.shortcut("bi.chart", BI.Chart);

50
src/addons/chart/chart/chart.abstract.js

@ -41,9 +41,9 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
LINE_WIDTH: 1, LINE_WIDTH: 1,
NUM_SEPARATORS: false, NUM_SEPARATORS: false,
FONT_STYLE: { FONT_STYLE: {
"fontFamily": "inherit", fontFamily: "inherit",
"color": "inherit", color: "inherit",
"fontSize": "12px" fontSize: "12px"
} }
}, },
@ -51,7 +51,7 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
return BI.extend(BI.AbstractChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AbstractChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-abstract-chart", baseCls: "bi-abstract-chart",
popupItemsGetter: BI.emptyFn popupItemsGetter: BI.emptyFn
}) });
}, },
_init: function () { _init: function () {
@ -101,12 +101,12 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
da.x = BI.contentFormat(BI.parseFloat(da.x.div(magnify).toFixed(4)), "#.####;-#.####"); da.x = BI.contentFormat(BI.parseFloat(da.x.div(magnify).toFixed(4)), "#.####;-#.####");
} }
}); });
}) });
}, },
formatXYDataWithMagnify: function (number, magnify) { formatXYDataWithMagnify: function (number, magnify) {
if (BI.isNull(number)) { if (BI.isNull(number)) {
return null return null;
} }
if (!BI.isNumber(number)) { if (!BI.isNumber(number)) {
number = BI.parseFloat(number); number = BI.parseFloat(number);
@ -173,46 +173,46 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
}, },
formatTickInXYaxis: function (type, number_level, separators, isCompareBar) { formatTickInXYaxis: function (type, number_level, separators, isCompareBar) {
var formatter = '#.##'; var formatter = "#.##";
switch (type) { switch (type) {
case this.constants.NORMAL: case this.constants.NORMAL:
formatter = '#.##'; formatter = "#.##";
if (separators) { if (separators) {
formatter = '#,###.##' formatter = "#,###.##";
} }
break; break;
case this.constants.ZERO2POINT: case this.constants.ZERO2POINT:
formatter = '#0'; formatter = "#0";
if (separators) { if (separators) {
formatter = '#,###'; formatter = "#,###";
} }
break; break;
case this.constants.ONE2POINT: case this.constants.ONE2POINT:
formatter = '#0.0'; formatter = "#0.0";
if (separators) { if (separators) {
formatter = '#,###.0'; formatter = "#,###.0";
} }
break; break;
case this.constants.TWO2POINT: case this.constants.TWO2POINT:
formatter = '#0.00'; formatter = "#0.00";
if (separators) { if (separators) {
formatter = '#,###.00'; formatter = "#,###.00";
} }
break; break;
} }
if (number_level === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) { if (number_level === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) {
formatter += '%'; formatter += "%";
} }
formatter += ";-" + formatter; formatter += ";-" + formatter;
if(isCompareBar) { if(isCompareBar) {
return function () { return function () {
arguments[0] = arguments[0] > 0 ? arguments[0] : (-1) * arguments[0]; arguments[0] = arguments[0] > 0 ? arguments[0] : (-1) * arguments[0];
return BI.contentFormat(arguments[0], formatter); return BI.contentFormat(arguments[0], formatter);
} };
} }
return function () { return function () {
return BI.contentFormat(arguments[0], formatter) return BI.contentFormat(arguments[0], formatter);
} };
}, },
formatDataLabel: function (state, items, config, style) { formatDataLabel: function (state, items, config, style) {
@ -220,8 +220,8 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
if (state === true) { if (state === true) {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
item.dataLabels = { item.dataLabels = {
"align": "outside", align: "outside",
"autoAdjust": true, autoAdjust: true,
style: style, style: style,
enabled: true, enabled: true,
formatter: { formatter: {
@ -238,13 +238,13 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
if (state === true) { if (state === true) {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
item.dataLabels = { item.dataLabels = {
"align": "outside", align: "outside",
"autoAdjust": true, autoAdjust: true,
style: style, style: style,
enabled: true, enabled: true,
formatter: { formatter: {
identifier: "${VALUE}", identifier: "${VALUE}",
valueFormat: format, valueFormat: format
} }
}; };
if(isPercentChart) { if(isPercentChart) {
@ -265,7 +265,7 @@ BI.AbstractChart = BI.inherit(BI.Widget, {
BI.each(config.yAxis, function (idx, axis) { BI.each(config.yAxis, function (idx, axis) {
axis.labelStyle = fontStyle; axis.labelStyle = fontStyle;
axis.title.style = fontStyle; axis.title.style = fontStyle;
}) });
}, },
_formatItems: function (items) { _formatItems: function (items) {

22
src/addons/chart/chart/chart.accumulatearea.js

@ -8,7 +8,7 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AccumulateAreaChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AccumulateAreaChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-accumulate-area-chart" baseCls: "bi-accumulate-area-chart"
}) });
}, },
_init: function () { _init: function () {
@ -35,7 +35,7 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AccumulateAreaChart.EVENT_CHANGE, obj); self.fireEvent(BI.AccumulateAreaChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -102,7 +102,7 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "area"; config.chartType = "area";
@ -152,9 +152,9 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -177,14 +177,14 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
}, },
@ -274,4 +274,4 @@ BI.AccumulateAreaChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AccumulateAreaChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AccumulateAreaChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.accumulate_area_chart', BI.AccumulateAreaChart); BI.shortcut("bi.accumulate_area_chart", BI.AccumulateAreaChart);

28
src/addons/chart/chart/chart.accumulateaxis.js

@ -8,7 +8,7 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AccumulateAxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AccumulateAxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-accumulate-axis-chart" baseCls: "bi-accumulate-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -33,7 +33,7 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AccumulateAxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.AccumulateAxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -93,7 +93,7 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
enableTick: self.config.enableTick, enableTick: self.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "column"; config.chartType = "column";
@ -115,9 +115,9 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -140,14 +140,14 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatChartStyle () { function formatChartStyle () {
@ -178,13 +178,13 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
unit = unit === "" ? unit : "(" + unit + ")"; unit = unit === "" ? unit : "(" + unit + ")";
@ -277,4 +277,4 @@ BI.AccumulateAxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AccumulateAxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AccumulateAxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.accumulate_axis_chart', BI.AccumulateAxisChart); BI.shortcut("bi.accumulate_axis_chart", BI.AccumulateAxisChart);

32
src/addons/chart/chart/chart.accumulatebar.js

@ -8,7 +8,7 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AccumulateBarChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AccumulateBarChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-accumulate-bar-chart" baseCls: "bi-accumulate-bar-chart"
}) });
}, },
_init: function () { _init: function () {
@ -21,7 +21,7 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
}, },
labelStyle: this.constants.FONT_STYLE, labelStyle: this.constants.FONT_STYLE,
formatter: function () { formatter: function () {
return this > 0 ? this : (-1) * this return this > 0 ? this : (-1) * this;
}, },
gridLineWidth: 0 gridLineWidth: 0
}]; }];
@ -45,7 +45,7 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AccumulateBarChart.EVENT_CHANGE, obj); self.fireEvent(BI.AccumulateBarChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -67,7 +67,7 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
lineWidth: this.config.lineWidth, lineWidth: this.config.lineWidth,
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
maxWidth: '40%' maxWidth: "40%"
}); });
self.formatNumberLevelInXaxis(items, this.config.leftYAxisNumberLevel); self.formatNumberLevelInXaxis(items, this.config.leftYAxisNumberLevel);
@ -111,9 +111,9 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -136,14 +136,14 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXYAxisUnit (numberLevelType, position) { function getXYAxisUnit (numberLevelType, position) {
@ -163,13 +163,13 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -184,7 +184,7 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
var tmp = t.x; var tmp = t.x;
t.x = t.y; t.x = t.y;
t.y = tmp; t.y = tmp;
}) });
}); });
}); });
return items; return items;
@ -243,4 +243,4 @@ BI.AccumulateBarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AccumulateBarChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AccumulateBarChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.accumulate_bar_chart', BI.AccumulateBarChart); BI.shortcut("bi.accumulate_bar_chart", BI.AccumulateBarChart);

16
src/addons/chart/chart/chart.accumulateradar.js

@ -8,7 +8,7 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AccumulateRadarChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AccumulateRadarChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-accumulate-radar-chart" baseCls: "bi-accumulate-radar-chart"
}) });
}, },
_init: function () { _init: function () {
@ -21,7 +21,7 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
}, },
labelStyle: this.constants.FONT_STYLE, labelStyle: this.constants.FONT_STYLE,
formatter: function () { formatter: function () {
return this > 0 ? this : (-1) * this return this > 0 ? this : (-1) * this;
}, },
gridLineWidth: 0, gridLineWidth: 0,
position: "bottom" position: "bottom"
@ -45,7 +45,7 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AccumulateRadarChart.EVENT_CHANGE, obj); self.fireEvent(BI.AccumulateRadarChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -119,7 +119,7 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
config.plotOptions.tooltip.formatter.valueFormat = formatter; config.plotOptions.tooltip.formatter.valueFormat = formatter;
} }
@ -141,13 +141,13 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -191,4 +191,4 @@ BI.AccumulateRadarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AccumulateRadarChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AccumulateRadarChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.accumulate_radar_chart', BI.AccumulateRadarChart); BI.shortcut("bi.accumulate_radar_chart", BI.AccumulateRadarChart);

28
src/addons/chart/chart/chart.area.js

@ -8,7 +8,7 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AreaChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AreaChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-area-chart" baseCls: "bi-area-chart"
}) });
}, },
_init: function () { _init: function () {
@ -34,7 +34,7 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AreaChart.EVENT_CHANGE, obj); self.fireEvent(BI.AreaChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -99,7 +99,7 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "area"; config.chartType = "area";
@ -131,9 +131,9 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -156,14 +156,14 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatChartLineStyle () { function formatChartLineStyle () {
@ -201,13 +201,13 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -299,4 +299,4 @@ BI.AreaChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AreaChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AreaChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.area_chart', BI.AreaChart); BI.shortcut("bi.area_chart", BI.AreaChart);

28
src/addons/chart/chart/chart.axis.js

@ -11,7 +11,7 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.AxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.AxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-axis-chart" baseCls: "bi-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -37,7 +37,7 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.AxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.AxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -102,7 +102,7 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
var lineItem = []; var lineItem = [];
@ -142,9 +142,9 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -164,14 +164,14 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXYAxisUnit (numberLevelType, position) { function getXYAxisUnit (numberLevelType, position) {
@ -191,13 +191,13 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -273,4 +273,4 @@ BI.AxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.AxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.AxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.axis_chart', BI.AxisChart); BI.shortcut("bi.axis_chart", BI.AxisChart);

30
src/addons/chart/chart/chart.bar.js

@ -8,7 +8,7 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BarChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BarChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-bar-chart" baseCls: "bi-bar-chart"
}) });
}, },
_init: function () { _init: function () {
@ -21,7 +21,7 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
}, },
labelStyle: this.constants.FONT_STYLE, labelStyle: this.constants.FONT_STYLE,
formatter: function () { formatter: function () {
return this > 0 ? this : (-1) * this return this > 0 ? this : (-1) * this;
}, },
gridLineWidth: 0 gridLineWidth: 0
}]; }];
@ -48,7 +48,7 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.BarChart.EVENT_CHANGE, obj); self.fireEvent(BI.BarChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -69,7 +69,7 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
lineWidth: this.config.lineWidth, lineWidth: this.config.lineWidth,
maxWidth: '40%' maxWidth: "40%"
}); });
// 值轴 // 值轴
@ -114,9 +114,9 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -136,14 +136,14 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXAxisTitle (numberLevelType, position) { function getXAxisTitle (numberLevelType, position) {
@ -163,10 +163,10 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
unit = unit === "" ? unit : "(" + unit + ")"; unit = unit === "" ? unit : "(" + unit + ")";
@ -181,7 +181,7 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
var tmp = t.x; var tmp = t.x;
t.x = t.y; t.x = t.y;
t.y = tmp; t.y = tmp;
}) });
}); });
}); });
return items; return items;
@ -238,4 +238,4 @@ BI.BarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.BarChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.BarChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.bar_chart', BI.BarChart); BI.shortcut("bi.bar_chart", BI.BarChart);

63
src/addons/chart/chart/chart.bubble.js

@ -8,7 +8,7 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.BubbleChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.BubbleChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-bubble-chart" baseCls: "bi-bubble-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.BubbleChart.EVENT_CHANGE, obj); self.fireEvent(BI.BubbleChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -66,7 +66,7 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
config.yAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0; config.yAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0;
config.yAxis[0].lineWidth = 1; config.yAxis[0].lineWidth = 1;
config.yAxis[0].title.rotation = this.constants.ROTATION; config.yAxis[0].title.rotation = this.constants.ROTATION;
config.yAxis[0].maxWidth = '40%'; config.yAxis[0].maxWidth = "40%";
config.xAxis[0].formatter = self.formatTickInXYaxis(this.config.xAxisStyle, this.config.xAxisNumberLevel, this.config.rightNumSeparators); config.xAxis[0].formatter = self.formatTickInXYaxis(this.config.xAxisStyle, this.config.xAxisNumberLevel, this.config.rightNumSeparators);
self.formatNumberLevelInXaxis(items, this.config.xAxisNumberLevel); self.formatNumberLevelInXaxis(items, this.config.xAxisNumberLevel);
@ -74,20 +74,21 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
config.xAxis[0].title.text = this.config.showXAxisTitle === true ? this.config.xAxisTitle + config.xAxis[0].title.text : config.xAxis[0].title.text; config.xAxis[0].title.text = this.config.showXAxisTitle === true ? this.config.xAxisTitle + config.xAxis[0].title.text : config.xAxis[0].title.text;
config.xAxis[0].title.align = "center"; config.xAxis[0].title.align = "center";
config.xAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0; config.xAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0;
config.xAxis[0].maxHeith = '40%'; config.xAxis[0].maxHeith = "40%";
config.chartType = "bubble"; config.chartType = "bubble";
if (BI.isNotEmptyArray(this.config.tooltip)) { if (BI.isNotEmptyArray(this.config.tooltip)) {
config.plotOptions.bubble.tooltip = { config.plotOptions.bubble.tooltip = {
useHtml: true, useHtml: true,
style: { style: {
color: 'RGB(184, 184, 184)' color: "RGB(184, 184, 184)"
}, },
formatter: function () { formatter: function () {
var y = self.formatTickInXYaxis(self.config.leftYAxisStyle, self.config.leftYAxisNumberLevel, self.config.numSeparators)(this.y); var y = self.formatTickInXYaxis(self.config.leftYAxisStyle, self.config.leftYAxisNumberLevel, self.config.numSeparators)(this.y);
var x = self.formatTickInXYaxis(self.config.xAxisStyle, self.config.xAxisNumberLevel, self.config.rightNumSeparators)(this.x); var x = self.formatTickInXYaxis(self.config.xAxisStyle, self.config.xAxisNumberLevel, self.config.rightNumSeparators)(this.x);
return this.seriesName + '<div>(X)' + self.config.tooltip[0] + ':' + x + '</div><div>(Y)' + self.config.tooltip[1] return this.seriesName + "<div>(X)" + self.config.tooltip[0] + ":" + x + "</div><div>(Y)" + self.config.tooltip[1]
+ ':' + y + '</div><div>(' + BI.i18nText("BI-Size") + ')' + self.config.tooltip[2] + ':' + this.size + '</div>'} + ":" + y + "</div><div>(" + BI.i18nText("BI-Size") + ")" + self.config.tooltip[2] + ":" + this.size + "</div>";
}
}; };
} }
@ -95,20 +96,20 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
if (config.plotOptions.dataLabels.enabled === true) { if (config.plotOptions.dataLabels.enabled === true) {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
item.dataLabels = { item.dataLabels = {
"style" : self.config.chartFont, style: self.config.chartFont,
"align": "outside", align: "outside",
"autoAdjust": true, autoAdjust: true,
enabled: true, enabled: true,
formatter: { formatter: {
identifier: "${X}${Y}${SIZE}", identifier: "${X}${Y}${SIZE}",
"XFormat": function () { XFormat: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
}, },
"YFormat": function () { YFormat: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
}, },
"sizeFormat": function () { sizeFormat: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
} }
} }
}; };
@ -143,9 +144,9 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -168,14 +169,14 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatNumberLevelInYaxis (type, position) { function formatNumberLevelInYaxis (type, position) {
@ -185,7 +186,7 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
if (type === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) { if (type === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) {
// config.plotOptions.tooltip.formatter.valueFormat = "function(){return window.FR ? FR.contentFormat(arguments[0], '#0%') : arguments[0]}"; // config.plotOptions.tooltip.formatter.valueFormat = "function(){return window.FR ? FR.contentFormat(arguments[0], '#0%') : arguments[0]}";
@ -209,13 +210,13 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -226,9 +227,9 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
BI.each(item, function (id, it) { BI.each(item, function (id, it) {
BI.each(it.data, function (i, da) { BI.each(it.data, function (i, da) {
var data = da.size; var data = da.size;
da.size = BI.contentFormat(data, '#.##;-#.##') da.size = BI.contentFormat(data, "#.##;-#.##");
}) });
}) });
}); });
return items; return items;
}, },
@ -279,4 +280,4 @@ BI.BubbleChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.BubbleChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.BubbleChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.bubble_chart', BI.BubbleChart); BI.shortcut("bi.bubble_chart", BI.BubbleChart);

28
src/addons/chart/chart/chart.comparearea.js

@ -8,7 +8,7 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.CompareAreaChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.CompareAreaChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-compare-area-chart" baseCls: "bi-compare-area-chart"
}) });
}, },
_init: function () { _init: function () {
@ -34,7 +34,7 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.CompareAreaChart.EVENT_CHANGE, obj); self.fireEvent(BI.CompareAreaChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -103,7 +103,7 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "area"; config.chartType = "area";
@ -165,9 +165,9 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -190,14 +190,14 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatChartLineStyle () { function formatChartLineStyle () {
@ -263,13 +263,13 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -370,4 +370,4 @@ BI.CompareAreaChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.CompareAreaChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.CompareAreaChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.compare_area_chart', BI.CompareAreaChart); BI.shortcut("bi.compare_area_chart", BI.CompareAreaChart);

30
src/addons/chart/chart/chart.compareaxis.js

@ -8,7 +8,7 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.CompareAxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.CompareAxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-compare-axis-chart" baseCls: "bi-compare-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.CompareAxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.CompareAxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -65,7 +65,7 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
config.yAxis = this.yAxis; config.yAxis = this.yAxis;
BI.each(config.yAxis, function (idx, axis) { BI.each(config.yAxis, function (idx, axis) {
var unit = ''; var unit = "";
switch (axis.axisIndex) { switch (axis.axisIndex) {
case self.constants.LEFT_AXIS: case self.constants.LEFT_AXIS:
unit = getXYAxisUnit(self.config.leftYAxisNumberLevel, self.constants.LEFT_AXIS); unit = getXYAxisUnit(self.config.leftYAxisNumberLevel, self.constants.LEFT_AXIS);
@ -112,7 +112,7 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
BI.extend(config.xAxis[1], { BI.extend(config.xAxis[1], {
@ -148,9 +148,9 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -173,14 +173,14 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatChartLineStyle () { function formatChartLineStyle () {
@ -240,13 +240,13 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if(position === self.constants.X_AXIS) { if(position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if(position === self.constants.LEFT_AXIS) { if(position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if(position === self.constants.RIGHT_AXIS) { if(position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -378,4 +378,4 @@ BI.CompareAxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.CompareAxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.CompareAxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.compare_axis_chart', BI.CompareAxisChart); BI.shortcut("bi.compare_axis_chart", BI.CompareAxisChart);

30
src/addons/chart/chart/chart.comparebar.js

@ -8,7 +8,7 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.CompareBarChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.CompareBarChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-compare-bar-chart" baseCls: "bi-compare-bar-chart"
}) });
}, },
_init: function () { _init: function () {
@ -45,7 +45,7 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.CompareBarChart.EVENT_CHANGE, obj); self.fireEvent(BI.CompareBarChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -67,7 +67,7 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
lineWidth: this.config.lineWidth, lineWidth: this.config.lineWidth,
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
maxWidth: '40%' maxWidth: "40%"
}); });
self.formatNumberLevelInXaxis(items, this.config.leftYAxisNumberLevel); self.formatNumberLevelInXaxis(items, this.config.leftYAxisNumberLevel);
@ -112,9 +112,9 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -137,14 +137,14 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXYAxisUnit (numberLevelType, position) { function getXYAxisUnit (numberLevelType, position) {
@ -164,13 +164,13 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -190,7 +190,7 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
it.stack = i; it.stack = i;
}) });
}); });
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
result = BI.concat(result, item); result = BI.concat(result, item);
@ -250,4 +250,4 @@ BI.CompareBarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.CompareBarChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.CompareBarChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.compare_bar_chart', BI.CompareBarChart); BI.shortcut("bi.compare_bar_chart", BI.CompareBarChart);

74
src/addons/chart/chart/chart.dashboard.js

@ -9,18 +9,18 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.DashboardChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.DashboardChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-dashboard-chart" baseCls: "bi-dashboard-chart"
}) });
}, },
_init: function () { _init: function () {
BI.DashboardChart.superclass._init.apply(this, arguments); BI.DashboardChart.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.gaugeAxis = [{ this.gaugeAxis = [{
"minorTickColor": "rgb(226,226,226)", minorTickColor: "rgb(226,226,226)",
"tickColor": "rgb(186,186,186)", tickColor: "rgb(186,186,186)",
labelStyle: this.constants.FONT_STYLE, labelStyle: this.constants.FONT_STYLE,
"step": 0, step: 0,
"showLabel": true showLabel: true
}]; }];
this.combineChart = BI.createWidget({ this.combineChart = BI.createWidget({
type: "bi.combine_chart", type: "bi.combine_chart",
@ -32,7 +32,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.DashboardChart.EVENT_CHANGE, obj); self.fireEvent(BI.DashboardChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -48,7 +48,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
if (isDashboard && !isMultiPointers) { if (isDashboard && !isMultiPointers) {
config.plotOptions.seriesLabel.enabled = false; config.plotOptions.seriesLabel.enabled = false;
if(BI.isNull(items[0].data[0].z)) { if(BI.isNull(items[0].data[0].z)) {
config.plotOptions.tooltip.formatter.identifier = "${SERIES}${X}${Y}${SIZE}${VALUE}" config.plotOptions.tooltip.formatter.identifier = "${SERIES}${X}${Y}${SIZE}${VALUE}";
} }
} }
config.gaugeAxis[0].labelStyle = this.config.chartFont; config.gaugeAxis[0].labelStyle = this.config.chartFont;
@ -66,29 +66,29 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
formatter: function () { formatter: function () {
var value = this.value; var value = this.value;
if (self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT && self.config.numSeparators) { if (self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT && self.config.numSeparators) {
value = BI.contentFormat(this.value, "#,##0%;-#,##0%") value = BI.contentFormat(this.value, "#,##0%;-#,##0%");
} else if (self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT && !self.config.numSeparators) { } else if (self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT && !self.config.numSeparators) {
value = BI.contentFormat(this.value, "#0.00%"); value = BI.contentFormat(this.value, "#0.00%");
} else if (!(self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) && self.config.numSeparators) { } else if (!(self.config.dashboardNumberLevel === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) && self.config.numSeparators) {
value = BI.contentFormat(this.value, "#,###.##;-#,###.##") value = BI.contentFormat(this.value, "#,###.##;-#,###.##");
} else { } else {
value = BI.contentFormat(this.value, "#.##;-#.##"); value = BI.contentFormat(this.value, "#.##;-#.##");
} }
var label = '<div style="text-align: center">' + this.seriesName + '</div>' + '<div style="text-align: center">' + value + var label = "<div style=\"text-align: center\">" + this.seriesName + "</div>" + "<div style=\"text-align: center\">" + value +
getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS) + '</div>'; getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS) + "</div>";
if (isDashboard && items[0].data.length > 1) { if (isDashboard && items[0].data.length > 1) {
if (isMultiPointers) { if (isMultiPointers) {
return '<div style="text-align: center">' + this.seriesName + ':' + value + return "<div style=\"text-align: center\">" + this.seriesName + ":" + value +
getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS) + '</div>'; getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS) + "</div>";
} }
return label return label;
} else if (isDashboard && BI.isNull(items[0].data[0].z)) { } else if (isDashboard && BI.isNull(items[0].data[0].z)) {
return label return label;
} }
return '<div style="text-align: center">' + this.category + '</div>' + label; return "<div style=\"text-align: center\">" + this.category + "</div>" + label;
}, },
style: self.config.chartFont, style: self.config.chartFont,
useHtml: true useHtml: true
@ -132,9 +132,9 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
config.gaugeAxis[0].formatter = function () { config.gaugeAxis[0].formatter = function () {
var scaleValue = this; var scaleValue = this;
if (self.config.numSeparators) { if (self.config.numSeparators) {
scaleValue = BI.contentFormat(scaleValue, '#,##0%;-#,##0%') scaleValue = BI.contentFormat(scaleValue, "#,##0%;-#,##0%");
} else { } else {
scaleValue = BI.contentFormat(scaleValue, '#0.00%') scaleValue = BI.contentFormat(scaleValue, "#0.00%");
} }
return scaleValue + getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS); return scaleValue + getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS);
}; };
@ -142,7 +142,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
config.gaugeAxis[0].formatter = function () { config.gaugeAxis[0].formatter = function () {
var value = this; var value = this;
if (self.config.numSeparators) { if (self.config.numSeparators) {
value = BI.contentFormat(value, "#,###;-#,###") value = BI.contentFormat(value, "#,###;-#,###");
} }
return value + getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS); return value + getXYAxisUnit(self.config.dashboardNumberLevel, self.constants.DASHBOARD_AXIS);
}; };
@ -170,26 +170,26 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
config.plotOptions.tooltip.formatter.valueFormat = function () { config.plotOptions.tooltip.formatter.valueFormat = function () {
return BI.contentFormat(this, '#.##;-#.##') + getXYAxisUnit(type, position) return BI.contentFormat(this, "#.##;-#.##") + getXYAxisUnit(type, position);
}; };
if (self.config.numSeparators) { if (self.config.numSeparators) {
config.plotOptions.tooltip.formatter.valueFormat = function () { config.plotOptions.tooltip.formatter.valueFormat = function () {
return BI.contentFormat(arguments[0], '#,###.##;-#,###.##') return BI.contentFormat(arguments[0], "#,###.##;-#,###.##");
}; };
} }
if (type === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) { if (type === BICst.TARGET_STYLE.NUM_LEVEL.PERCENT) {
config.plotOptions.tooltip.formatter.valueFormat = function () { config.plotOptions.tooltip.formatter.valueFormat = function () {
return BI.contentFormat(arguments[0], '#0.00%') return BI.contentFormat(arguments[0], "#0.00%");
}; };
if (self.config.numSeparators) { if (self.config.numSeparators) {
config.plotOptions.tooltip.formatter.valueFormat = function () { config.plotOptions.tooltip.formatter.valueFormat = function () {
return BI.contentFormat(arguments[0], '#,##0%;-#,##0%') return BI.contentFormat(arguments[0], "#,##0%;-#,##0%");
}; };
} }
} }
@ -212,7 +212,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.DASHBOARD_AXIS) { if (position === self.constants.DASHBOARD_AXIS) {
self.config.dashboardUnit !== "" && (unit = unit + self.config.dashboardUnit) self.config.dashboardUnit !== "" && (unit = unit + self.config.dashboardUnit);
} }
return unit; return unit;
} }
@ -223,7 +223,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
var data = item.data[0]; var data = item.data[0];
if ((BI.isNull(max) || data.y > max)) { if ((BI.isNull(max) || data.y > max)) {
max = data.y max = data.y;
} }
}); });
@ -233,8 +233,8 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
break; break;
case BICst.SCALE_SETTING.CUSTOM: case BICst.SCALE_SETTING.CUSTOM:
if (styles.length === 0) { if (styles.length === 0) {
return bands return bands;
} else { }
var maxScale = _calculateValueNiceDomain(0, max)[1]; var maxScale = _calculateValueNiceDomain(0, max)[1];
BI.each(styles, function (idx, style) { BI.each(styles, function (idx, style) {
@ -251,7 +251,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
to: style.range.max to: style.range.max
}); });
color = style.color; color = style.color;
conditionMax = style.range.max conditionMax = style.range.max;
}); });
min = BI.parseInt(styles[0].range.min); min = BI.parseInt(styles[0].range.min);
bands.push({ bands.push({
@ -267,7 +267,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
}); });
return bands; return bands;
}
} }
} }
@ -310,7 +310,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
x: items[0][0].name x: items[0][0].name
})], })],
name: da.x name: da.x
}) });
}); });
return [result]; return [result];
} else if(this.config.numberOfPointer === c.ONE_POINTER && items[0].length > 1) { } else if(this.config.numberOfPointer === c.ONE_POINTER && items[0].length > 1) {
@ -320,9 +320,9 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
x: item.name x: item.name
})], })],
name: BI.UUID() name: BI.UUID()
})
}); });
return [result] });
return [result];
} }
if (this.config.numberOfPointer === c.MULTI_POINTER && items[0].length > 1) {// 多个系列 if (this.config.numberOfPointer === c.MULTI_POINTER && items[0].length > 1) {// 多个系列
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
@ -330,7 +330,7 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
var data = it.data[0]; var data = it.data[0];
data.x = it.name; data.x = it.name;
result.push(data); result.push(data);
}) });
}); });
return [[{ return [[{
data: result, data: result,
@ -348,8 +348,8 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
y: da.y y: da.y
})], })],
name: da.x name: da.x
}) });
}) });
}); });
return [others]; return [others];
} }
@ -395,4 +395,4 @@ BI.DashboardChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.DashboardChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.DashboardChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.dashboard_chart', BI.DashboardChart); BI.shortcut("bi.dashboard_chart", BI.DashboardChart);

8
src/addons/chart/chart/chart.donut.js

@ -8,7 +8,7 @@ BI.DonutChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.DonutChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.DonutChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-donut-chart" baseCls: "bi-donut-chart"
}) });
}, },
_init: function () { _init: function () {
@ -24,7 +24,7 @@ BI.DonutChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.DonutChart.EVENT_CHANGE, obj); self.fireEvent(BI.DonutChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -49,7 +49,7 @@ BI.DonutChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, da) { BI.each(item.data, function (id, da) {
da.y = self.formatXYDataWithMagnify(da.y, 1); da.y = self.formatXYDataWithMagnify(da.y, 1);
}) });
}); });
config.legend.style = this.config.chartFont; config.legend.style = this.config.chartFont;
@ -100,4 +100,4 @@ BI.DonutChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.DonutChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.DonutChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.donut_chart', BI.DonutChart); BI.shortcut("bi.donut_chart", BI.DonutChart);

40
src/addons/chart/chart/chart.fallaxis.js

@ -8,7 +8,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.FallAxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.FallAxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-fall-axis-chart" baseCls: "bi-fall-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.FallAxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.FallAxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -86,7 +86,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
// 为了给数据标签加个%,还要遍历所有的系列,唉 // 为了给数据标签加个%,还要遍历所有的系列,唉
@ -97,9 +97,9 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
return; return;
} }
item.dataLabels = { item.dataLabels = {
"style": self.config.chartFont, style: self.config.chartFont,
"align": "outside", align: "outside",
"autoAdjust": true, autoAdjust: true,
enabled: true, enabled: true,
formatter: { formatter: {
identifier: "${VALUE}", identifier: "${VALUE}",
@ -133,9 +133,9 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -158,14 +158,14 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatNumberLevelInYaxis (type, position, formatter) { function formatNumberLevelInYaxis (type, position, formatter) {
@ -175,7 +175,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
config.plotOptions.tooltip.formatter.valueFormat = formatter; config.plotOptions.tooltip.formatter.valueFormat = formatter;
} }
@ -197,13 +197,13 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if(position === self.constants.X_AXIS) { if(position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if(position === self.constants.LEFT_AXIS) { if(position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if(position === self.constants.RIGHT_AXIS) { if(position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -233,7 +233,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
return [BI.map(BI.makeArray(2, null), function (idx, item) { return [BI.map(BI.makeArray(2, null), function (idx, item) {
return { return {
"data": BI.map(tables, function(id, cell){ data: BI.map(tables, function (id, cell) {
var axis = BI.extend({}, cell[3], { var axis = BI.extend({}, cell[3], {
x: cell[0], x: cell[0],
y: Math.abs(cell[2 - idx]) y: Math.abs(cell[2 - idx])
@ -248,7 +248,7 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
axis.mouseOverColor = "rgba(0,0,0,0)"; axis.mouseOverColor = "rgba(0,0,0,0)";
axis.tooltip = { axis.tooltip = {
enable: false enable: false
} };
} }
return axis; return axis;
}), }),
@ -307,4 +307,4 @@ BI.FallAxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.FallAxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.FallAxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.fall_axis_chart', BI.FallAxisChart); BI.shortcut("bi.fall_axis_chart", BI.FallAxisChart);

10
src/addons/chart/chart/chart.forcebubble.js

@ -8,7 +8,7 @@ BI.ForceBubbleChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.ForceBubbleChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.ForceBubbleChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-force-bubble-chart" baseCls: "bi-force-bubble-chart"
}) });
}, },
_init: function () { _init: function () {
@ -24,13 +24,13 @@ BI.ForceBubbleChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.ForceBubbleChart.EVENT_CHANGE, obj); self.fireEvent(BI.ForceBubbleChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
_formatConfig: function (config, items) { _formatConfig: function (config, items) {
var self = this, o = this.options; var self = this, o = this.options;
config.chartType = 'forceBubble'; config.chartType = "forceBubble";
config.colors = this.config.chartColor; config.colors = this.config.chartColor;
this.formatChartLegend(config, this.config.chartLegend); this.formatChartLegend(config, this.config.chartLegend);
@ -46,7 +46,7 @@ BI.ForceBubbleChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, da) { BI.each(item.data, function (id, da) {
da.y = self.formatXYDataWithMagnify(da.y, 1); da.y = self.formatXYDataWithMagnify(da.y, 1);
}) });
}); });
config.legend.style = this.config.chartFont; config.legend.style = this.config.chartFont;
return [items, config]; return [items, config];
@ -84,4 +84,4 @@ BI.ForceBubbleChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.ForceBubbleChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.ForceBubbleChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.force_bubble_chart', BI.ForceBubbleChart); BI.shortcut("bi.force_bubble_chart", BI.ForceBubbleChart);

20
src/addons/chart/chart/chart.gismap.js

@ -8,7 +8,7 @@ BI.GISMapChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.GISMapChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.GISMapChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-gis-map-chart" baseCls: "bi-gis-map-chart"
}) });
}, },
_init: function () { _init: function () {
@ -24,7 +24,7 @@ BI.GISMapChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.GISMapChart.EVENT_CHANGE, obj); self.fireEvent(BI.GISMapChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -36,29 +36,29 @@ BI.GISMapChart = BI.inherit(BI.AbstractChart, {
config.plotOptions.dataLabels.useHtml = true; config.plotOptions.dataLabels.useHtml = true;
config.plotOptions.dataLabels.style = this.config.chartFont; config.plotOptions.dataLabels.style = this.config.chartFont;
config.plotOptions.dataLabels.formatter = function () { config.plotOptions.dataLabels.formatter = function () {
var name = (BI.isArray(this.name) ? '' : this.name + ',') + BI.contentFormat(this.value, '#.##;-#.##') ; var name = (BI.isArray(this.name) ? "" : this.name + ",") + BI.contentFormat(this.value, "#.##;-#.##");
var style = "padding: 5px; background-color: rgba(0,0,0,0.4980392156862745);border-color: rgb(0,0,0); border-radius:2px; border-width:0px;"; var style = "padding: 5px; background-color: rgba(0,0,0,0.4980392156862745);border-color: rgb(0,0,0); border-radius:2px; border-width:0px;";
var a = '<div style = ' + style + '>' + name + '</div>'; var a = "<div style = " + style + ">" + name + "</div>";
return a; return a;
}; };
config.plotOptions.tooltip.shared = true; config.plotOptions.tooltip.shared = true;
config.plotOptions.tooltip.formatter = function () { config.plotOptions.tooltip.formatter = function () {
var tip = BI.isArray(this.name) ? '' : this.name; var tip = BI.isArray(this.name) ? "" : this.name;
BI.each(this.points, function (idx, point) { BI.each(this.points, function (idx, point) {
tip += ('<div>' + point.seriesName + ':' + BI.contentFormat((point.size || point.y), '#.##;-#.##') + '</div>'); tip += ("<div>" + point.seriesName + ":" + BI.contentFormat((point.size || point.y), "#.##;-#.##") + "</div>");
}); });
return tip; return tip;
}; };
config.geo = { config.geo = {
"tileLayer": "http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}", tileLayer: "http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
"attribution": "<a><img src='http://webapi.amap.com/theme/v1.3/mapinfo_05.png'>&copy; 2016 AutoNavi</a>" attribution: "<a><img src='http://webapi.amap.com/theme/v1.3/mapinfo_05.png'>&copy; 2016 AutoNavi</a>"
}; };
if (this.config.showBackgroundLayer === true && BI.isNotNull(this.config.backgroundLayerInfo)) { if (this.config.showBackgroundLayer === true && BI.isNotNull(this.config.backgroundLayerInfo)) {
config.geo = {}; config.geo = {};
if (this.config.backgroundLayerInfo.type === BICst.WMS_SERVER) { if (this.config.backgroundLayerInfo.type === BICst.WMS_SERVER) {
config.geo.tileLayer = false; config.geo.tileLayer = false;
config.geo.wmsUrl = this.config.backgroundLayerInfo.url; config.geo.wmsUrl = this.config.backgroundLayerInfo.url;
config.geo.wmsLayer = this.config.backgroundLayerInfo.wmsLayer config.geo.wmsLayer = this.config.backgroundLayerInfo.wmsLayer;
} else { } else {
config.geo.tileLayer = this.config.backgroundLayerInfo.url; config.geo.tileLayer = this.config.backgroundLayerInfo.url;
} }
@ -157,4 +157,4 @@ BI.GISMapChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.GISMapChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.GISMapChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.gis_map_chart', BI.GISMapChart); BI.shortcut("bi.gis_map_chart", BI.GISMapChart);

28
src/addons/chart/chart/chart.line.js

@ -8,7 +8,7 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.LineChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.LineChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-line-chart" baseCls: "bi-line-chart"
}) });
}, },
_init: function () { _init: function () {
@ -34,7 +34,7 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.LineChart.EVENT_CHANGE, obj); self.fireEvent(BI.LineChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -100,7 +100,7 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: self.config.enableMinorTick, enableMinorTick: self.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "line"; config.chartType = "line";
@ -132,9 +132,9 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -157,14 +157,14 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatChartLineStyle () { function formatChartLineStyle () {
@ -202,13 +202,13 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -294,4 +294,4 @@ BI.LineChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.LineChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.LineChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.line_chart', BI.LineChart); BI.shortcut("bi.line_chart", BI.LineChart);

52
src/addons/chart/chart/chart.map.js

@ -8,7 +8,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.MapChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.MapChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-map-chart" baseCls: "bi-map-chart"
}) });
}, },
_init: function () { _init: function () {
@ -24,7 +24,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.MapChart.EVENT_CHANGE, obj); self.fireEvent(BI.MapChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -46,7 +46,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
var tip = this.name; var tip = this.name;
var point = this.points[0]; var point = this.points[0];
var index = BI.isNull(point.size) ? 0 : 1; var index = BI.isNull(point.size) ? 0 : 1;
tip += ('<div>' + point.seriesName + ':' + BI.contentFormat(point.size || point.y, formatterArray[index]) + '</div>'); tip += ("<div>" + point.seriesName + ":" + BI.contentFormat(point.size || point.y, formatterArray[index]) + "</div>");
return tip; return tip;
}; };
config.plotOptions.dataLabels.formatter.valueFormat = function () { config.plotOptions.dataLabels.formatter.valueFormat = function () {
@ -64,7 +64,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
if (this.config.backgroundLayerInfo.type === BICst.WMS_SERVER) { if (this.config.backgroundLayerInfo.type === BICst.WMS_SERVER) {
config.geo.tileLayer = false; config.geo.tileLayer = false;
config.geo.wmsUrl = this.config.backgroundLayerInfo.url; config.geo.wmsUrl = this.config.backgroundLayerInfo.url;
config.geo.wmsLayer = this.config.backgroundLayerInfo.wmsLayer config.geo.wmsLayer = this.config.backgroundLayerInfo.wmsLayer;
} else { } else {
config.geo.tileLayer = this.config.backgroundLayerInfo.url; config.geo.tileLayer = this.config.backgroundLayerInfo.url;
} }
@ -89,7 +89,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
items.push({ items.push({
type: "areaMap", type: "areaMap",
data: [] data: []
}) });
} }
return [items, config]; return [items, config];
@ -117,36 +117,36 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
var settings = items[0].settings; var settings = items[0].settings;
var legendFormat = formatToolTipAndDataLabel(settings.format || c.NORMAL, settings.num_level || c.NORMAL, var legendFormat = formatToolTipAndDataLabel(settings.format || c.NORMAL, settings.num_level || c.NORMAL,
settings.unit || "", settings.numSeparators || c.NUM_SEPARATORS); settings.unit || "", settings.numSeparators || c.NUM_SEPARATORS);
to = BI.contentFormat(to, legendFormat) to = BI.contentFormat(to, legendFormat);
} }
return to return to;
}; };
} }
function formatToolTipAndDataLabel (format, numberLevel, unit, numSeparators) { function formatToolTipAndDataLabel (format, numberLevel, unit, numSeparators) {
var formatter = '#.##'; var formatter = "#.##";
switch (format) { switch (format) {
case self.constants.NORMAL: case self.constants.NORMAL:
formatter = '#.##'; formatter = "#.##";
if (numSeparators) formatter = '#,###.##'; if (numSeparators) formatter = "#,###.##";
break; break;
case self.constants.ZERO2POINT: case self.constants.ZERO2POINT:
formatter = '#0'; formatter = "#0";
if (numSeparators) formatter = '#,###'; if (numSeparators) formatter = "#,###";
break; break;
case self.constants.ONE2POINT: case self.constants.ONE2POINT:
formatter = '#0.0'; formatter = "#0.0";
if (numSeparators) formatter = '#,###.0'; if (numSeparators) formatter = "#,###.0";
break; break;
case self.constants.TWO2POINT: case self.constants.TWO2POINT:
formatter = '#0.00'; formatter = "#0.00";
if (numSeparators) formatter = '#,###.00'; if (numSeparators) formatter = "#,###.00";
break; break;
} }
switch (numberLevel) { switch (numberLevel) {
case BICst.TARGET_STYLE.NUM_LEVEL.NORMAL: case BICst.TARGET_STYLE.NUM_LEVEL.NORMAL:
formatter += ''; formatter += "";
break; break;
case BICst.TARGET_STYLE.NUM_LEVEL.TEN_THOUSAND: case BICst.TARGET_STYLE.NUM_LEVEL.TEN_THOUSAND:
formatter += BI.i18nText("BI-Wan"); formatter += BI.i18nText("BI-Wan");
@ -158,7 +158,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
formatter += BI.i18nText("BI-Yi"); formatter += BI.i18nText("BI-Yi");
break; break;
case BICst.TARGET_STYLE.NUM_LEVEL.PERCENT: case BICst.TARGET_STYLE.NUM_LEVEL.PERCENT:
formatter += '%'; formatter += "%";
break; break;
} }
@ -172,9 +172,9 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, it) { BI.each(item.data, function (id, it) {
if (BI.isNull(min) || BI.parseFloat(min) > BI.parseFloat(it.y)) { if (BI.isNull(min) || BI.parseFloat(min) > BI.parseFloat(it.y)) {
min = it.y min = it.y;
} }
}) });
}); });
switch (change) { switch (change) {
@ -196,11 +196,11 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
range.push({ range.push({
color: style.color || "rgba(255,255,255,0)", color: style.color || "rgba(255,255,255,0)",
from: style.range.min, from: style.range.min,
to: to, to: to
}); });
} }
color = style.color; color = style.color;
conditionMax = style.range.max conditionMax = style.range.max;
}); });
conditionMin = BI.parseFloat(styles[0].range.min); conditionMin = BI.parseFloat(styles[0].range.min);
@ -220,10 +220,10 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
}); });
} }
return range; return range;
} else { }
defaultStyle.color = defaultColor; defaultStyle.color = defaultColor;
return defaultStyle; return defaultStyle;
}
} }
} }
@ -313,7 +313,7 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
self._formatDrillItems(da.drilldown); self._formatDrillItems(da.drilldown);
} }
}); });
}) });
}); });
return items; return items;
}, },
@ -358,4 +358,4 @@ BI.MapChart = BI.inherit(BI.AbstractChart, {
}); });
BI.MapChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.MapChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.MapChart.EVENT_CLICK_DTOOL = "EVENT_CLICK_DTOOL"; BI.MapChart.EVENT_CLICK_DTOOL = "EVENT_CLICK_DTOOL";
BI.shortcut('bi.map_chart', BI.MapChart); BI.shortcut("bi.map_chart", BI.MapChart);

54
src/addons/chart/chart/chart.multiaxis.js

@ -11,7 +11,7 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.MultiAxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.MultiAxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-axis-chart" baseCls: "bi-multi-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -20,10 +20,10 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
this.xAxis = [{ this.xAxis = [{
type: "category", type: "category",
title: { title: {
style: {"fontFamily": "inherit", "color": "#808080", "fontSize": "12px", "fontWeight": ""} style: {fontFamily: "inherit", color: "#808080", fontSize: "12px", fontWeight: ""}
}, },
labelStyle: { labelStyle: {
"fontFamily": "inherit", "color": "#808080", "fontSize": "12px" fontFamily: "inherit", color: "#808080", fontSize: "12px"
}, },
position: "bottom", position: "bottom",
gridLineWidth: 0 gridLineWidth: 0
@ -39,7 +39,7 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.MultiAxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.MultiAxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -120,7 +120,7 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
// 为了给数据标签加个%,还要遍历所有的系列,唉 // 为了给数据标签加个%,还要遍历所有的系列,唉
@ -161,14 +161,14 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": { style: {
"fontFamily": "inherit", fontFamily: "inherit",
"color": "#808080", color: "#808080",
"fontSize": "12px", fontSize: "12px",
"fontWeight": "" fontWeight: ""
}, },
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -193,19 +193,19 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": { style: {
"fontFamily": "inherit", fontFamily: "inherit",
"color": "#808080", color: "#808080",
"fontSize": "12px", fontSize: "12px",
"fontWeight": "" fontWeight: ""
}, },
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
}, },
getXYAxisUnit: function (numberLevelType, position) { getXYAxisUnit: function (numberLevelType, position) {
@ -227,16 +227,16 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === this.constants.X_AXIS) { if (position === this.constants.X_AXIS) {
this.config.xAxisUnit !== "" && (unit = unit + this.config.xAxisUnit) this.config.xAxisUnit !== "" && (unit = unit + this.config.xAxisUnit);
} }
if (position === this.constants.LEFT_AXIS) { if (position === this.constants.LEFT_AXIS) {
this.config.leftYAxisUnit !== "" && (unit = unit + this.config.leftYAxisUnit) this.config.leftYAxisUnit !== "" && (unit = unit + this.config.leftYAxisUnit);
} }
if (position === this.constants.RIGHT_AXIS) { if (position === this.constants.RIGHT_AXIS) {
this.config.rightYAxisUnit !== "" && (unit = unit + this.config.rightYAxisUnit) this.config.rightYAxisUnit !== "" && (unit = unit + this.config.rightYAxisUnit);
} }
if (position === this.constants.RIGHT_AXIS_SECOND) { if (position === this.constants.RIGHT_AXIS_SECOND) {
this.config.rightYAxisSecondUnit !== "" && (unit = unit + this.config.rightYAxisSecondUnit) this.config.rightYAxisSecondUnit !== "" && (unit = unit + this.config.rightYAxisSecondUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
}, },
@ -294,10 +294,10 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
var newYAxis = { var newYAxis = {
type: "value", type: "value",
title: { title: {
style: {"fontFamily": "inherit", "color": "#808080", "fontSize": "12px", "fontWeight": ""} style: {fontFamily: "inherit", color: "#808080", fontSize: "12px", fontWeight: ""}
}, },
labelStyle: { labelStyle: {
"fontFamily": "inherit", "color": "#808080", "fontSize": "12px" fontFamily: "inherit", color: "#808080", fontSize: "12px"
}, },
position: idx > 0 ? "right" : "left", position: idx > 0 ? "right" : "left",
lineWidth: 1, lineWidth: 1,
@ -319,4 +319,4 @@ BI.MultiAxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.MultiAxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiAxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.multi_axis_chart', BI.MultiAxisChart); BI.shortcut("bi.multi_axis_chart", BI.MultiAxisChart);

54
src/addons/chart/chart/chart.multiaxiscombine.js

@ -11,7 +11,7 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.MultiAxisCombineChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.MultiAxisCombineChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-multi-axis-combine-chart" baseCls: "bi-multi-axis-combine-chart"
}) });
}, },
_init: function () { _init: function () {
@ -20,10 +20,10 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
this.xAxis = [{ this.xAxis = [{
type: "category", type: "category",
title: { title: {
style: {"fontFamily": "inherit", "color": "#808080", "fontSize": "12px", "fontWeight": ""} style: {fontFamily: "inherit", color: "#808080", fontSize: "12px", fontWeight: ""}
}, },
labelStyle: { labelStyle: {
"fontFamily": "inherit", "color": "#808080", "fontSize": "12px" fontFamily: "inherit", color: "#808080", fontSize: "12px"
}, },
position: "bottom", position: "bottom",
gridLineWidth: 0 gridLineWidth: 0
@ -39,7 +39,7 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.MultiAxisCombineChart.EVENT_CHANGE, obj); self.fireEvent(BI.MultiAxisCombineChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -123,7 +123,7 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
// 为了给数据标签加个%,还要遍历所有的系列,唉 // 为了给数据标签加个%,还要遍历所有的系列,唉
@ -164,14 +164,14 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": { style: {
"fontFamily": "inherit", fontFamily: "inherit",
"color": "#808080", color: "#808080",
"fontSize": "12px", fontSize: "12px",
"fontWeight": "" fontWeight: ""
}, },
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -196,19 +196,19 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": { style: {
"fontFamily": "inherit", fontFamily: "inherit",
"color": "#808080", color: "#808080",
"fontSize": "12px", fontSize: "12px",
"fontWeight": "" fontWeight: ""
}, },
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
}, },
getXYAxisUnit: function (numberLevelType, position) { getXYAxisUnit: function (numberLevelType, position) {
@ -230,16 +230,16 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === this.constants.X_AXIS) { if (position === this.constants.X_AXIS) {
this.config.xAxisUnit !== "" && (unit = unit + this.config.xAxisUnit) this.config.xAxisUnit !== "" && (unit = unit + this.config.xAxisUnit);
} }
if (position === this.constants.LEFT_AXIS) { if (position === this.constants.LEFT_AXIS) {
this.config.leftYAxisUnit !== "" && (unit = unit + this.config.leftYAxisUnit) this.config.leftYAxisUnit !== "" && (unit = unit + this.config.leftYAxisUnit);
} }
if (position === this.constants.RIGHT_AXIS) { if (position === this.constants.RIGHT_AXIS) {
this.config.rightYAxisUnit !== "" && (unit = unit + this.config.rightYAxisUnit) this.config.rightYAxisUnit !== "" && (unit = unit + this.config.rightYAxisUnit);
} }
if (position === this.constants.RIGHT_AXIS_SECOND) { if (position === this.constants.RIGHT_AXIS_SECOND) {
this.config.rightYAxisSecondUnit !== "" && (unit = unit + this.config.rightYAxisSecondUnit) this.config.rightYAxisSecondUnit !== "" && (unit = unit + this.config.rightYAxisSecondUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
}, },
@ -296,10 +296,10 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
var newYAxis = { var newYAxis = {
type: "value", type: "value",
title: { title: {
style: {"fontFamily": "inherit", "color": "#808080", "fontSize": "12px", "fontWeight": ""} style: {fontFamily: "inherit", color: "#808080", fontSize: "12px", fontWeight: ""}
}, },
labelStyle: { labelStyle: {
"fontFamily": "inherit", "color": "#808080", "fontSize": "12px" fontFamily: "inherit", color: "#808080", fontSize: "12px"
}, },
position: idx > 0 ? "right" : "left", position: idx > 0 ? "right" : "left",
lineWidth: 1, lineWidth: 1,
@ -321,4 +321,4 @@ BI.MultiAxisCombineChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.MultiAxisCombineChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiAxisCombineChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.multi_axis_combine_chart', BI.MultiAxisCombineChart); BI.shortcut("bi.multi_axis_combine_chart", BI.MultiAxisCombineChart);

28
src/addons/chart/chart/chart.percentaccumulatearea.js

@ -8,7 +8,7 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.PercentAccumulateAreaChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.PercentAccumulateAreaChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-percent-accumulate-area-chart" baseCls: "bi-percent-accumulate-area-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.PercentAccumulateAreaChart.EVENT_CHANGE, obj); self.fireEvent(BI.PercentAccumulateAreaChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -84,7 +84,7 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "area"; config.chartType = "area";
@ -116,9 +116,9 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -141,14 +141,14 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXYAxisUnit (numberLevelType, position) { function getXYAxisUnit (numberLevelType, position) {
@ -168,15 +168,15 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
unit = unit === "" ? unit : "(" + unit + ")"; unit = unit === "" ? unit : "(" + unit + ")";
return self.config.showLeftYAxisTitle === true ? self.config.leftYAxisTitle + unit : unit return self.config.showLeftYAxisTitle === true ? self.config.leftYAxisTitle + unit : unit;
} }
}, },
@ -242,4 +242,4 @@ BI.PercentAccumulateAreaChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.PercentAccumulateAreaChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.PercentAccumulateAreaChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.percent_accumulate_area_chart', BI.PercentAccumulateAreaChart); BI.shortcut("bi.percent_accumulate_area_chart", BI.PercentAccumulateAreaChart);

26
src/addons/chart/chart/chart.percentaccumulateaxis.js

@ -8,7 +8,7 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.PercentAccumulateAxisChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.PercentAccumulateAxisChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-percent-accumulate-axis-chart" baseCls: "bi-percent-accumulate-axis-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.PercentAccumulateAxisChart.EVENT_CHANGE, obj); self.fireEvent(BI.PercentAccumulateAxisChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -85,7 +85,7 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
enableMinorTick: this.config.enableMinorTick, enableMinorTick: this.config.enableMinorTick,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
// 为了给数据标签加个%,还要遍历所有的系列,唉 // 为了给数据标签加个%,还要遍历所有的系列,唉
@ -115,9 +115,9 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -140,14 +140,14 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function getXYAxisUnit (numberLevelType, position) { function getXYAxisUnit (numberLevelType, position) {
@ -167,10 +167,10 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -237,4 +237,4 @@ BI.PercentAccumulateAxisChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.PercentAccumulateAxisChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.PercentAccumulateAxisChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.percent_accumulate_axis_chart', BI.PercentAccumulateAxisChart); BI.shortcut("bi.percent_accumulate_axis_chart", BI.PercentAccumulateAxisChart);

14
src/addons/chart/chart/chart.pie.js

@ -8,7 +8,7 @@ BI.PieChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.PieChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.PieChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-pie-chart" baseCls: "bi-pie-chart"
}) });
}, },
_init: function () { _init: function () {
@ -24,7 +24,7 @@ BI.PieChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.PieChart.EVENT_CHANGE, obj); self.fireEvent(BI.PieChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -50,7 +50,7 @@ BI.PieChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, da) { BI.each(item.data, function (id, da) {
da.y = self.formatXYDataWithMagnify(da.y, 1); da.y = self.formatXYDataWithMagnify(da.y, 1);
}) });
}); });
config.legend.style = this.config.chartFont; config.legend.style = this.config.chartFont;
@ -107,10 +107,10 @@ BI.PieChart = BI.inherit(BI.AbstractChart, {
}); });
}); });
return seriesItem; return seriesItem;
}) });
}else{
return items;
} }
return items;
}, },
populate: function (items, options) { populate: function (items, options) {
@ -149,5 +149,5 @@ BI.PieChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.PieChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.PieChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.pie_chart', BI.PieChart); BI.shortcut("bi.pie_chart", BI.PieChart);

16
src/addons/chart/chart/chart.radar.js

@ -8,7 +8,7 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RadarChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RadarChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-radar-chart" baseCls: "bi-radar-chart"
}) });
}, },
_init: function () { _init: function () {
@ -21,7 +21,7 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
}, },
labelStyle: this.constants.FONT_STYLE, labelStyle: this.constants.FONT_STYLE,
formatter: function () { formatter: function () {
return this > 0 ? this : (-1) * this return this > 0 ? this : (-1) * this;
}, },
gridLineWidth: 0, gridLineWidth: 0,
position: "bottom" position: "bottom"
@ -45,7 +45,7 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.RadarChart.EVENT_CHANGE, obj); self.fireEvent(BI.RadarChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -110,7 +110,7 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
config.plotOptions.tooltip.formatter.valueFormat = formatter; config.plotOptions.tooltip.formatter.valueFormat = formatter;
} }
@ -132,13 +132,13 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -182,4 +182,4 @@ BI.RadarChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.RadarChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.RadarChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.radar_chart', BI.RadarChart); BI.shortcut("bi.radar_chart", BI.RadarChart);

28
src/addons/chart/chart/chart.rangearea.js

@ -9,7 +9,7 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.RangeAreaChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.RangeAreaChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-range-area-chart" baseCls: "bi-range-area-chart"
}) });
}, },
_init: function () { _init: function () {
@ -44,7 +44,7 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.RangeAreaChart.EVENT_CHANGE, obj); self.fireEvent(BI.RangeAreaChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -79,7 +79,7 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
enableTick: this.config.enableTick, enableTick: this.config.enableTick,
labelRotation: this.config.textDirection, labelRotation: this.config.textDirection,
gridLineWidth: this.config.showGridLine === true ? 1 : 0, gridLineWidth: this.config.showGridLine === true ? 1 : 0,
maxHeight: '40%' maxHeight: "40%"
}); });
config.chartType = "area"; config.chartType = "area";
@ -112,9 +112,9 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -137,14 +137,14 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style" : self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatNumberLevelInYaxis (type, position, formatter) { function formatNumberLevelInYaxis (type, position, formatter) {
@ -154,7 +154,7 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
if (position === item.yAxis) { if (position === item.yAxis) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
} }
}) });
}); });
config.plotOptions.tooltip.formatter.valueFormat = formatter; config.plotOptions.tooltip.formatter.valueFormat = formatter;
} }
@ -176,10 +176,10 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -281,4 +281,4 @@ BI.RangeAreaChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.RangeAreaChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.RangeAreaChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.range_area_chart', BI.RangeAreaChart); BI.shortcut("bi.range_area_chart", BI.RangeAreaChart);

56
src/addons/chart/chart/chart.scatter.js

@ -8,7 +8,7 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.ScatterChart.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.ScatterChart.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-scatter-chart" baseCls: "bi-scatter-chart"
}) });
}, },
_init: function () { _init: function () {
@ -43,7 +43,7 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
self.fireEvent(BI.ScatterChart.EVENT_CHANGE, obj); self.fireEvent(BI.ScatterChart.EVENT_CHANGE, obj);
}); });
this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) { this.combineChart.on(BI.CombineChart.EVENT_ITEM_CLICK, function (obj) {
self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj) self.fireEvent(BI.AbstractChart.EVENT_ITEM_CLICK, obj);
}); });
}, },
@ -53,7 +53,7 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
delete config.zoom; delete config.zoom;
config.colors = this.config.chartColor; config.colors = this.config.chartColor;
config.style = formatChartStyle(); config.style = formatChartStyle();
config.plotOptions.marker = {"symbol": "circle", "radius": 4.5, "enabled": true}; config.plotOptions.marker = {symbol: "circle", radius: 4.5, enabled: true};
formatCordon(); formatCordon();
this.formatChartLegend(config, this.config.chartLegend); this.formatChartLegend(config, this.config.chartLegend);
config.plotOptions.dataLabels.enabled = this.config.showDataLabel; config.plotOptions.dataLabels.enabled = this.config.showDataLabel;
@ -68,7 +68,7 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
config.yAxis[0].title.text = this.config.showLeftYAxisTitle === true ? this.config.leftYAxisTitle + config.yAxis[0].title.text : config.yAxis[0].title.text; config.yAxis[0].title.text = this.config.showLeftYAxisTitle === true ? this.config.leftYAxisTitle + config.yAxis[0].title.text : config.yAxis[0].title.text;
config.yAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0; config.yAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0;
config.yAxis[0].title.rotation = this.constants.ROTATION; config.yAxis[0].title.rotation = this.constants.ROTATION;
config.yAxis[0].maxWidth = '40%'; config.yAxis[0].maxWidth = "40%";
config.xAxis[0].formatter = self.formatTickInXYaxis(this.config.xAxisStyle, this.config.xAxisNumberLevel, this.config.rightNumSeparators); config.xAxis[0].formatter = self.formatTickInXYaxis(this.config.xAxisStyle, this.config.xAxisNumberLevel, this.config.rightNumSeparators);
formatNumberLevelInXaxis(this.config.xAxisNumberLevel); formatNumberLevelInXaxis(this.config.xAxisNumberLevel);
@ -76,32 +76,32 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
config.xAxis[0].title.text = this.config.showXAxisTitle === true ? this.config.xAxisTitle + config.xAxis[0].title.text : config.xAxis[0].title.text; config.xAxis[0].title.text = this.config.showXAxisTitle === true ? this.config.xAxisTitle + config.xAxis[0].title.text : config.xAxis[0].title.text;
config.xAxis[0].title.align = "center"; config.xAxis[0].title.align = "center";
config.xAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0; config.xAxis[0].gridLineWidth = this.config.showGridLine === true ? 1 : 0;
config.xAxis[0].maxHeight = '40%'; config.xAxis[0].maxHeight = "40%";
config.chartType = "scatter"; config.chartType = "scatter";
if (BI.isNotEmptyArray(this.config.tooltip)) { if (BI.isNotEmptyArray(this.config.tooltip)) {
config.plotOptions.tooltip.formatter = function () { config.plotOptions.tooltip.formatter = function () {
var y = self.formatTickInXYaxis(self.config.leftYAxisStyle, self.config.leftYAxisNumberLevel, self.config.numSeparators)(this.y); var y = self.formatTickInXYaxis(self.config.leftYAxisStyle, self.config.leftYAxisNumberLevel, self.config.numSeparators)(this.y);
var x = self.formatTickInXYaxis(self.config.xAxisStyle, self.config.xAxisNumberLevel, self.config.rightNumSeparators)(this.x); var x = self.formatTickInXYaxis(self.config.xAxisStyle, self.config.xAxisNumberLevel, self.config.rightNumSeparators)(this.x);
return this.seriesName + '<div>(X)' + self.config.tooltip[0] return this.seriesName + "<div>(X)" + self.config.tooltip[0]
+ ':' + x + '</div><div>(Y)' + self.config.tooltip[1] + ':' + y + '</div>' + ":" + x + "</div><div>(Y)" + self.config.tooltip[1] + ":" + y + "</div>";
}; };
} }
if (config.plotOptions.dataLabels.enabled === true) { if (config.plotOptions.dataLabels.enabled === true) {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
item.dataLabels = { item.dataLabels = {
"style": self.config.chartFont, style: self.config.chartFont,
"align": "outside", align: "outside",
"autoAdjust": true, autoAdjust: true,
enabled: true, enabled: true,
formatter: { formatter: {
identifier: "${X}${Y}", identifier: "${X}${Y}",
"XFormat": function () { XFormat: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
}, },
"YFormat": function () { YFormat: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
} }
} }
}; };
@ -136,9 +136,9 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "top" align: "top"
} }
}); });
}); });
@ -161,14 +161,14 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
value: t.value.div(magnify), value: t.value.div(magnify),
width: 1, width: 1,
label: { label: {
"style": self.config.chartFont, style: self.config.chartFont,
"text": t.text, text: t.text,
"align": "left" align: "left"
} }
}); });
}); });
} }
}) });
} }
function formatNumberLevelInXaxis (type) { function formatNumberLevelInXaxis (type) {
@ -176,8 +176,8 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, da) { BI.each(item.data, function (id, da) {
da.x = self.formatXYDataWithMagnify(da.x, magnify); da.x = self.formatXYDataWithMagnify(da.x, magnify);
}) });
}) });
} }
function formatNumberLevelInYaxis (type) { function formatNumberLevelInYaxis (type) {
@ -185,7 +185,7 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
BI.each(items, function (idx, item) { BI.each(items, function (idx, item) {
BI.each(item.data, function (id, da) { BI.each(item.data, function (id, da) {
da.y = self.formatXYDataWithMagnify(da.y, magnify); da.y = self.formatXYDataWithMagnify(da.y, magnify);
}) });
}); });
} }
@ -206,13 +206,13 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
break; break;
} }
if (position === self.constants.X_AXIS) { if (position === self.constants.X_AXIS) {
self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit) self.config.xAxisUnit !== "" && (unit = unit + self.config.xAxisUnit);
} }
if (position === self.constants.LEFT_AXIS) { if (position === self.constants.LEFT_AXIS) {
self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit) self.config.leftYAxisUnit !== "" && (unit = unit + self.config.leftYAxisUnit);
} }
if (position === self.constants.RIGHT_AXIS) { if (position === self.constants.RIGHT_AXIS) {
self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit) self.config.rightYAxisUnit !== "" && (unit = unit + self.config.rightYAxisUnit);
} }
return unit === "" ? unit : "(" + unit + ")"; return unit === "" ? unit : "(" + unit + ")";
} }
@ -263,4 +263,4 @@ BI.ScatterChart = BI.inherit(BI.AbstractChart, {
} }
}); });
BI.ScatterChart.EVENT_CHANGE = "EVENT_CHANGE"; BI.ScatterChart.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut('bi.scatter_chart', BI.ScatterChart); BI.shortcut("bi.scatter_chart", BI.ScatterChart);

366
src/addons/chart/factory.charts.js

@ -12,55 +12,55 @@ BI.ChartCombineFormatItemFactory = {
case BICst.WIDGET.BAR: case BICst.WIDGET.BAR:
case BICst.WIDGET.ACCUMULATE_BAR: case BICst.WIDGET.ACCUMULATE_BAR:
case BICst.WIDGET.COMPARE_BAR: case BICst.WIDGET.COMPARE_BAR:
item = BI.extend({"type": "bar"}, items); item = BI.extend({type: "bar"}, items);
break; break;
case BICst.WIDGET.BUBBLE: case BICst.WIDGET.BUBBLE:
item = BI.extend({"type": "bubble"}, items); item = BI.extend({type: "bubble"}, items);
break; break;
case BICst.WIDGET.FORCE_BUBBLE: case BICst.WIDGET.FORCE_BUBBLE:
item = BI.extend({"type": "forceBubble"}, items); item = BI.extend({type: "forceBubble"}, items);
break; break;
case BICst.WIDGET.SCATTER: case BICst.WIDGET.SCATTER:
item = BI.extend({"type": "scatter"}, items); item = BI.extend({type: "scatter"}, items);
break; break;
case BICst.WIDGET.AXIS: case BICst.WIDGET.AXIS:
case BICst.WIDGET.ACCUMULATE_AXIS: case BICst.WIDGET.ACCUMULATE_AXIS:
case BICst.WIDGET.PERCENT_ACCUMULATE_AXIS: case BICst.WIDGET.PERCENT_ACCUMULATE_AXIS:
case BICst.WIDGET.COMPARE_AXIS: case BICst.WIDGET.COMPARE_AXIS:
case BICst.WIDGET.FALL_AXIS: case BICst.WIDGET.FALL_AXIS:
item = BI.extend({"type": "column"}, items); item = BI.extend({type: "column"}, items);
break; break;
case BICst.WIDGET.LINE: case BICst.WIDGET.LINE:
item = BI.extend({"type": "line"}, items); item = BI.extend({type: "line"}, items);
break; break;
case BICst.WIDGET.AREA: case BICst.WIDGET.AREA:
case BICst.WIDGET.ACCUMULATE_AREA: case BICst.WIDGET.ACCUMULATE_AREA:
case BICst.WIDGET.COMPARE_AREA: case BICst.WIDGET.COMPARE_AREA:
case BICst.WIDGET.RANGE_AREA: case BICst.WIDGET.RANGE_AREA:
case BICst.WIDGET.PERCENT_ACCUMULATE_AREA: case BICst.WIDGET.PERCENT_ACCUMULATE_AREA:
item = BI.extend({"type": "area"}, items); item = BI.extend({type: "area"}, items);
break; break;
case BICst.WIDGET.DONUT: case BICst.WIDGET.DONUT:
item = BI.extend({"type": "pie"}, items); item = BI.extend({type: "pie"}, items);
break; break;
case BICst.WIDGET.RADAR: case BICst.WIDGET.RADAR:
case BICst.WIDGET.ACCUMULATE_RADAR: case BICst.WIDGET.ACCUMULATE_RADAR:
item = BI.extend({"type": "radar"}, items); item = BI.extend({type: "radar"}, items);
break; break;
case BICst.WIDGET.PIE: case BICst.WIDGET.PIE:
item = BI.extend({"type": "pie"}, items); item = BI.extend({type: "pie"}, items);
break; break;
case BICst.WIDGET.DASHBOARD: case BICst.WIDGET.DASHBOARD:
item = BI.extend({"type": "gauge"}, items); item = BI.extend({type: "gauge"}, items);
break; break;
case BICst.WIDGET.MAP: case BICst.WIDGET.MAP:
item = BI.extend({"type": "areaMap"}, items); item = BI.extend({type: "areaMap"}, items);
break; break;
case BICst.WIDGET.GIS_MAP: case BICst.WIDGET.GIS_MAP:
item = BI.extend({"type": "pointMap"}, items); item = BI.extend({type: "pointMap"}, items);
break; break;
default: default:
item = BI.extend({"type": "column"}, items); item = BI.extend({type: "column"}, items);
break; break;
} }
return item; return item;
@ -68,177 +68,177 @@ BI.ChartCombineFormatItemFactory = {
combineConfig: function () { combineConfig: function () {
return { return {
"title": "", title: "",
"chartType": "column", chartType: "column",
"plotOptions": { plotOptions: {
"rotatable": false, rotatable: false,
"startAngle": 0, startAngle: 0,
"borderRadius": 0, borderRadius: 0,
"endAngle": 360, endAngle: 360,
"innerRadius": "0.0%", innerRadius: "0.0%",
"layout": "horizontal", layout: "horizontal",
"hinge": "rgb(101,107,109)", hinge: "rgb(101,107,109)",
"dataLabels": { dataLabels: {
"autoAdjust": true, autoAdjust: true,
"style": {"fontFamily": "inherit", "color": "inherit", "fontSize": "12px"}, style: {fontFamily: "inherit", color: "inherit", fontSize: "12px"},
"formatter": { formatter: {
"identifier": "${VALUE}", identifier: "${VALUE}",
"valueFormat": this._contentFormat2Decimal, valueFormat: this._contentFormat2Decimal,
"seriesFormat": this._contentFormat, seriesFormat: this._contentFormat,
"percentFormat": this._contentFormatPercentage, percentFormat: this._contentFormatPercentage,
"categoryFormat": this._contentFormat, categoryFormat: this._contentFormat,
"XFormat": this._contentFormat2Decimal, XFormat: this._contentFormat2Decimal,
"YFormat": this._contentFormat2Decimal, YFormat: this._contentFormat2Decimal,
"sizeFormat": this._contentFormat2Decimal sizeFormat: this._contentFormat2Decimal
}, },
"align": "outside", align: "outside",
"enabled": false enabled: false
}, },
"percentageLabel": { percentageLabel: {
"formatter": { formatter: {
"identifier": "${PERCENT}", identifier: "${PERCENT}",
"valueFormat": this._contentFormat2Decimal, valueFormat: this._contentFormat2Decimal,
"seriesFormat": this._contentFormat, seriesFormat: this._contentFormat,
"percentFormat": this._contentFormatPercentage, percentFormat: this._contentFormatPercentage,
"categoryFormat": this._contentFormat categoryFormat: this._contentFormat
}, },
"style": { style: {
"fontFamily": "inherit", "color": "inherit", "fontSize": "12px" fontFamily: "inherit", color: "inherit", fontSize: "12px"
}, },
"align": "bottom", align: "bottom",
"enabled": true enabled: true
}, },
"valueLabel": { valueLabel: {
"formatter": { formatter: {
"identifier": "${SERIES}${VALUE}", identifier: "${SERIES}${VALUE}",
"valueFormat": this._contentFormat2Decimal, valueFormat: this._contentFormat2Decimal,
"seriesFormat": this._contentFormat, seriesFormat: this._contentFormat,
"percentFormat": this._contentFormatPercentage, percentFormat: this._contentFormatPercentage,
"categoryFormat": this._contentFormat categoryFormat: this._contentFormat
}, },
"backgroundColor": "rgb(255,255,0)", backgroundColor: "rgb(255,255,0)",
"style": { style: {
"fontFamily": "inherit", "color": "inherit", "fontSize": "12px" fontFamily: "inherit", color: "inherit", fontSize: "12px"
}, },
"align": "inside", align: "inside",
"enabled": true enabled: true
}, },
"hingeBackgroundColor": "rgb(220,242,249)", hingeBackgroundColor: "rgb(220,242,249)",
"seriesLabel": { seriesLabel: {
"formatter": { formatter: {
"identifier": "${CATEGORY}", identifier: "${CATEGORY}",
"valueFormat": this._contentFormat2Decimal, valueFormat: this._contentFormat2Decimal,
"seriesFormat": this._contentFormat, seriesFormat: this._contentFormat,
"percentFormat": this._contentFormatPercentage, percentFormat: this._contentFormatPercentage,
"categoryFormat": this._contentFormat categoryFormat: this._contentFormat
}, },
"style": { style: {
"fontFamily": "inherit", "color": "inherit", "fontSize": "12px" fontFamily: "inherit", color: "inherit", fontSize: "12px"
}, },
"align": "bottom", align: "bottom",
"enabled": true enabled: true
}, },
"paneBackgroundColor": "rgb(252,252,252)", paneBackgroundColor: "rgb(252,252,252)",
"needle": "rgb(229,113,90)", needle: "rgb(229,113,90)",
"large": false, large: false,
"connectNulls": false, connectNulls: false,
"shadow": true, shadow: true,
"curve": false, curve: false,
"sizeBy": "area", sizeBy: "area",
"tooltip": { tooltip: {
"formatter": { formatter: {
"identifier": "${SERIES}${X}${Y}${SIZE}{CATEGORY}${SERIES}${VALUE}", identifier: "${SERIES}${X}${Y}${SIZE}{CATEGORY}${SERIES}${VALUE}",
"valueFormat": this._contentFormat2Decimal, valueFormat: this._contentFormat2Decimal,
"seriesFormat": this._contentFormat, seriesFormat: this._contentFormat,
"percentFormat": this._contentFormatPercentage, percentFormat: this._contentFormatPercentage,
"categoryFormat": this._contentFormat, categoryFormat: this._contentFormat,
"XFormat": this._contentFormat2Decimal, XFormat: this._contentFormat2Decimal,
"sizeFormat": this._contentFormat2Decimal, sizeFormat: this._contentFormat2Decimal,
"YFormat": this._contentFormat2Decimal YFormat: this._contentFormat2Decimal
}, },
"shared": false, shared: false,
"padding": 5, padding: 5,
"backgroundColor": "rgba(0,0,0,0.4980392156862745)", backgroundColor: "rgba(0,0,0,0.4980392156862745)",
"borderColor": "rgb(0,0,0)", borderColor: "rgb(0,0,0)",
"shadow": false, shadow: false,
"borderRadius": 2, borderRadius: 2,
"borderWidth": 0, borderWidth: 0,
"follow": false, follow: false,
"enabled": true, enabled: true,
"animation": true, animation: true,
"style": { style: {
"fontFamily": "Microsoft YaHei, Hiragino Sans GB W3", fontFamily: "Microsoft YaHei, Hiragino Sans GB W3",
"color": "#c4c6c6", color: "#c4c6c6",
"fontSize": "12px", fontSize: "12px",
"fontWeight": "" fontWeight: ""
} }
}, },
"maxSize": 80, maxSize: 80,
"fillColorOpacity": 0.5, fillColorOpacity: 0.5,
"step": false, step: false,
"force": false, force: false,
"minSize": 15, minSize: 15,
"displayNegative": true, displayNegative: true,
"categoryGap": "16.0%", categoryGap: "16.0%",
"borderColor": "rgb(255,255,255)", borderColor: "rgb(255,255,255)",
"borderWidth": 1, borderWidth: 1,
"gap": "22.0%", gap: "22.0%",
"animation": true, animation: true,
"lineWidth": 2, lineWidth: 2,
"bubble": { bubble: {
"large": false, large: false,
"connectNulls": false, connectNulls: false,
"shadow": true, shadow: true,
"curve": false, curve: false,
"sizeBy": "area", sizeBy: "area",
"maxSize": 80, maxSize: 80,
"minSize": 15, minSize: 15,
"lineWidth": 0, lineWidth: 0,
"animation": true, animation: true,
"fillColorOpacity": 0.699999988079071, fillColorOpacity: 0.699999988079071,
"marker": { marker: {
"symbol": "circle", symbol: "circle",
"radius": 28.39695010101295, radius: 28.39695010101295,
"enabled": true enabled: true
} }
} }
}, },
"dTools": { dTools: {
"enabled": false, enabled: false,
"style": { style: {
"fontFamily": "Microsoft YaHei, Hiragino Sans GB W3", fontFamily: "Microsoft YaHei, Hiragino Sans GB W3",
"color": "#1a1a1a", color: "#1a1a1a",
"fontSize": "12px" fontSize: "12px"
}, },
"backgroundColor": 'white' backgroundColor: "white"
}, },
"dataSheet": { dataSheet: {
"enabled": false, enabled: false,
"borderColor": "rgb(0,0,0)", borderColor: "rgb(0,0,0)",
"borderWidth": 1, borderWidth: 1,
"formatter": this._contentFormat2Decimal, formatter: this._contentFormat2Decimal,
"style": { style: {
"fontFamily": "inherit", "color": "inherit", "fontSize": "12px" fontFamily: "inherit", color: "inherit", fontSize: "12px"
} }
}, },
"borderColor": "rgb(238,238,238)", borderColor: "rgb(238,238,238)",
"shadow": false, shadow: false,
"legend": { legend: {
"borderColor": "rgb(204,204,204)", borderColor: "rgb(204,204,204)",
"borderRadius": 0, borderRadius: 0,
"shadow": false, shadow: false,
"borderWidth": 0, borderWidth: 0,
"visible": true, visible: true,
"style": { style: {
"fontFamily": "inherit", "color": "inherit", "fontSize": "12px" fontFamily: "inherit", color: "inherit", fontSize: "12px"
}, },
"position": "right", position: "right",
"enabled": false enabled: false
}, },
"rangeLegend": { rangeLegend: {
"range": { range: {
"min": 0, min: 0,
"color": [ color: [
[ [
0, 0,
"rgb(182,226,255)" "rgb(182,226,255)"
@ -252,40 +252,40 @@ BI.ChartCombineFormatItemFactory = {
"rgb(36,167,255)" "rgb(36,167,255)"
] ]
], ],
"max": 266393 max: 266393
}, },
"enabled": false enabled: false
}, },
"zoom": {"zoomType": "xy", "zoomTool": {"visible": false, "resize": true, "from": "", "to": ""}}, zoom: {zoomType: "xy", zoomTool: {visible: false, resize: true, from: "", to: ""}},
"plotBorderColor": "rgba(255,255,255,0)", plotBorderColor: "rgba(255,255,255,0)",
"tools": { tools: {
"hidden": false, hidden: false,
"toImage": {"enabled": false}, toImage: {enabled: false},
"sort": {"enabled": false}, sort: {enabled: false},
"fullScreen": {"enabled": false}, fullScreen: {enabled: false},
"refresh": { refresh: {
"enabled": false enabled: false
} }
}, },
"plotBorderWidth": 0, plotBorderWidth: 0,
"style": "normal", style: "normal",
"colors": ["rgb(99,178,238)", "rgb(118,218,145)"], colors: ["rgb(99,178,238)", "rgb(118,218,145)"],
"borderRadius": 0, borderRadius: 0,
"borderWidth": 0, borderWidth: 0,
"plotShadow": false, plotShadow: false,
"plotBorderRadius": 0 plotBorderRadius: 0
}; };
}, },
_contentFormat: function () { _contentFormat: function () {
return BI.contentFormat(arguments[0], '') return BI.contentFormat(arguments[0], "");
}, },
_contentFormat2Decimal: function () { _contentFormat2Decimal: function () {
return BI.contentFormat(arguments[0], '#.##;-#.##') return BI.contentFormat(arguments[0], "#.##;-#.##");
}, },
_contentFormatPercentage: function () { _contentFormatPercentage: function () {
return BI.contentFormat(arguments[0], '#.##%;-#.##%') return BI.contentFormat(arguments[0], "#.##%;-#.##%");
} }
}; };

6
src/base/canvas/canvas.js

@ -10,14 +10,14 @@ BI.Canvas = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-canvas" baseCls: "bi-canvas"
}) });
}, },
_init: function () { _init: function () {
BI.Canvas.superclass._init.apply(this, arguments); BI.Canvas.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
var canvas = document.createElement("canvas"); var canvas = document.createElement("canvas");
if (!document.createElement('canvas').getContext) { if (!document.createElement("canvas").getContext) {
canvas = window.G_vmlCanvasManager.initElement(canvas); canvas = window.G_vmlCanvasManager.initElement(canvas);
} }
this.element.append(canvas); this.element.append(canvas);
@ -35,7 +35,7 @@ BI.Canvas = BI.inherit(BI.Widget, {
_getContext: function () { _getContext: function () {
if (!this.ctx) { if (!this.ctx) {
this.ctx = this.canvas.getContext('2d'); this.ctx = this.canvas.getContext("2d");
} }
return this.ctx; return this.ctx;
}, },

10
src/base/collection/collection.js

@ -100,7 +100,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
_cellRenderers: function (height, width, x, y) { _cellRenderers: function (height, width, x, y) {
this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y); this._lastRenderedCellIndices = this._sectionManager.getCellIndices(height, width, x, y);
return this._cellGroupRenderer() return this._cellGroupRenderer();
}, },
_cellGroupRenderer: function () { _cellGroupRenderer: function () {
@ -239,7 +239,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
}); });
var addedItems = []; var addedItems = [];
BI.each(addSet, function (index, key) { BI.each(addSet, function (index, key) {
addedItems.push(renderedCells[key[1]]) addedItems.push(renderedCells[key[1]]);
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
// 拦截父子级关系 // 拦截父子级关系
@ -315,7 +315,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b; this.options.overflowX = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({overflowX: !!b ? "auto" : "hidden"}); self.element.css({overflowX: b ? "auto" : "hidden"});
}); });
} }
}, },
@ -325,7 +325,7 @@ BI.CollectionView = BI.inherit(BI.Widget, {
if (this.options.overflowY !== !!b) { if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b; this.options.overflowY = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({overflowY: !!b ? "auto" : "hidden"}); self.element.css({overflowY: b ? "auto" : "hidden"});
}); });
} }
}, },
@ -375,4 +375,4 @@ BI.CollectionView = BI.inherit(BI.Widget, {
} }
}); });
BI.CollectionView.EVENT_SCROLL = "EVENT_SCROLL"; BI.CollectionView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut('bi.collection_view', BI.CollectionView); BI.shortcut("bi.collection_view", BI.CollectionView);

20
src/base/combination/combo.js

@ -26,7 +26,7 @@ BI.Combo = BI.inherit(BI.Widget, {
popup: {}, popup: {},
comboClass: "bi-combo-popup", comboClass: "bi-combo-popup",
hoverClass: "bi-combo-hover" hoverClass: "bi-combo-hover"
}) });
}, },
_init: function () { _init: function () {
@ -319,31 +319,31 @@ BI.Combo = BI.inherit(BI.Widget, {
switch (o.direction) { switch (o.direction) {
case "bottom": case "bottom":
case "bottom,right": case "bottom,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'right', 'left'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "right", "left"], o.offsetStyle);
break; break;
case "top": case "top":
case "top,right": case "top,right":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'right', 'left'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "right", "left"], o.offsetStyle);
break; break;
case "left": case "left":
case "left,bottom": case "left,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'bottom', 'top'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "bottom", "top"], o.offsetStyle);
break; break;
case "right": case "right":
case "right,bottom": case "right,bottom":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'bottom', 'top'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "bottom", "top"], o.offsetStyle);
break; break;
case "top,left": case "top,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['top', 'bottom', 'left', 'right'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["top", "bottom", "left", "right"], o.offsetStyle);
break; break;
case "bottom,left": case "bottom,left":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ['bottom', 'top', 'left', 'right'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset, o.adjustYOffset || o.adjustLength, o.isNeedAdjustHeight, ["bottom", "top", "left", "right"], o.offsetStyle);
break; break;
case "left,top": case "left,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['left', 'right', 'top', 'bottom'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["left", "right", "top", "bottom"], o.offsetStyle);
break; break;
case "right,top": case "right,top":
p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ['right', 'left', 'top', 'bottom'], o.offsetStyle); p = $.getComboPosition(this.combo, this.popupView, o.adjustXOffset || o.adjustLength, o.adjustYOffset, o.isNeedAdjustHeight, ["right", "left", "top", "bottom"], o.offsetStyle);
break; break;
case "top,custom": case "top,custom":
case "custom,top": case "custom,top":
@ -368,7 +368,7 @@ BI.Combo = BI.inherit(BI.Widget, {
} }
if ("adaptHeight" in p) { if ("adaptHeight" in p) {
this.resetListHeight(p['adaptHeight']); this.resetListHeight(p["adaptHeight"]);
} }
if ("left" in p) { if ("left" in p) {
this.popupView.element.css({ this.popupView.element.css({

10
src/base/combination/expander.js

@ -18,7 +18,7 @@ BI.Expander = BI.inherit(BI.Widget, {
popup: {}, popup: {},
expanderClass: "bi-expander-popup", expanderClass: "bi-expander-popup",
hoverClass: "bi-expander-hover" hoverClass: "bi-expander-hover"
}) });
}, },
_init: function () { _init: function () {
@ -92,13 +92,13 @@ BI.Expander = BI.inherit(BI.Widget, {
self.element[e](function (e) { self.element[e](function (e) {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid()) {
self._popupView(); self._popupView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.expander); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander);
self.fireEvent(BI.Expander.EVENT_EXPAND); self.fireEvent(BI.Expander.EVENT_EXPAND);
} }
}, function () { }, function () {
if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid() && o.toggle) { if (self.isEnabled() && self.isValid() && self.expander.isEnabled() && self.expander.isValid() && o.toggle) {
self._hideView(); self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.expander);
self.fireEvent(BI.Expander.EVENT_COLLAPSE); self.fireEvent(BI.Expander.EVENT_COLLAPSE);
} }
}); });
@ -113,7 +113,7 @@ BI.Expander = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.expander);
self.fireEvent(BI.Expander.EVENT_EXPAND); self.fireEvent(BI.Expander.EVENT_EXPAND);
} else { } else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.expander); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.expander);
self.fireEvent(BI.Expander.EVENT_COLLAPSE); self.fireEvent(BI.Expander.EVENT_COLLAPSE);
} }
} }
@ -122,7 +122,7 @@ BI.Expander = BI.inherit(BI.Widget, {
} }
break; break;
} }
}) });
}, },
_initExpander: function () { _initExpander: function () {

18
src/base/combination/group.button.js

@ -16,7 +16,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
hgap: 0, hgap: 0,
vgap: 0 vgap: 0
}] }]
}) });
}, },
_init: function () { _init: function () {
@ -25,7 +25,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
BI.each(this.options.behaviors, function (key, rule) { BI.each(this.options.behaviors, function (key, rule) {
behaviors[key] = BI.BehaviorFactory.createBehavior(key, { behaviors[key] = BI.BehaviorFactory.createBehavior(key, {
rule: rule rule: rule
}) });
}); });
this.behaviors = behaviors; this.behaviors = behaviors;
this.populate(this.options.items); this.populate(this.options.items);
@ -65,7 +65,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
}); });
btn.on(BI.Events.DESTROY, function () { btn.on(BI.Events.DESTROY, function () {
BI.remove(self.buttons, btn); BI.remove(self.buttons, btn);
}) });
}); });
return buttons; return buttons;
@ -81,8 +81,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
el: it el: it
}) })
] ]
}) });
}) });
} }
return btns; return btns;
}, },
@ -95,8 +95,8 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
} }
return BI.extend({}, item, { return BI.extend({}, item, {
el: btns[i] el: btns[i]
}) });
}) });
}, },
_packageItems: function (items, packBtns) { _packageItems: function (items, packBtns) {
@ -117,7 +117,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
// 如果是一个简单的layout // 如果是一个简单的layout
_isSimpleLayout: function () { _isSimpleLayout: function () {
var o = this.options; var o = this.options;
return o.layouts.length === 1 && !BI.isArray(o.items[0]) return o.layouts.length === 1 && !BI.isArray(o.items[0]);
}, },
doBehavior: function () { doBehavior: function () {
@ -125,7 +125,7 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
args.unshift(this.buttons); args.unshift(this.buttons);
BI.each(this.behaviors, function (i, behavior) { BI.each(this.behaviors, function (i, behavior) {
behavior.doBehavior.apply(behavior, args); behavior.doBehavior.apply(behavior, args);
}) });
}, },
prependItems: function (items) { prependItems: function (items) {

8
src/base/combination/group.combo.js

@ -27,7 +27,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
}] }]
} }
} }
}) });
}, },
_init: function () { _init: function () {
@ -57,7 +57,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
ch.adjustLength = o.adjustLength; ch.adjustLength = o.adjustLength;
ch.popup = o.popup; ch.popup = o.popup;
} }
}) });
this.combo = BI.createWidget({ this.combo = BI.createWidget({
type: "bi.combo", type: "bi.combo",
element: this, element: this,
@ -74,13 +74,13 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
items: children items: children
}, o.popup.el) }, o.popup.el)
}) })
}) });
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
self.fireEvent(BI.ComboGroup.EVENT_CHANGE, obj); self.fireEvent(BI.ComboGroup.EVENT_CHANGE, obj);
} }
}) });
}, },
getValue: function () { getValue: function () {

6
src/base/combination/group.virtual.js

@ -8,7 +8,7 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
hgap: 0, hgap: 0,
vgap: 0 vgap: 0
}] }]
}) });
}, },
render: function () { render: function () {
@ -26,8 +26,8 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
el: BI.stripEL(it) el: BI.stripEL(it)
}) })
] ]
}) });
}) });
} }
return items; return items;
}, },

8
src/base/combination/loader.js

@ -32,7 +32,7 @@ BI.Loader = BI.inherit(BI.Widget, {
next: {}, next: {},
hasPrev: BI.emptyFn, hasPrev: BI.emptyFn,
hasNext: BI.emptyFn hasNext: BI.emptyFn
}) });
}, },
_prevLoad: function () { _prevLoad: function () {
@ -95,7 +95,7 @@ BI.Loader = BI.inherit(BI.Widget, {
if (type === BI.Events.CLICK) { if (type === BI.Events.CLICK) {
self._nextLoad(); self._nextLoad();
} }
}) });
} }
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
@ -122,7 +122,7 @@ BI.Loader = BI.inherit(BI.Widget, {
return !!o.hasPrev.apply(this, [{ return !!o.hasPrev.apply(this, [{
times: this.times, times: this.times,
count: this.count count: this.count
}]) }]);
}, },
hasNext: function () { hasNext: function () {
@ -133,7 +133,7 @@ BI.Loader = BI.inherit(BI.Widget, {
return !!o.hasNext.apply(this, [{ return !!o.hasNext.apply(this, [{
times: this.times, times: this.times,
count: this.count count: this.count
}]) }]);
}, },
prependItems: function (items) { prependItems: function (items) {

2
src/base/combination/navigation.js

@ -18,7 +18,7 @@ BI.Navigation = BI.inherit(BI.Widget, {
afterCardCreated: BI.emptyFn, afterCardCreated: BI.emptyFn,
afterCardShow: BI.emptyFn afterCardShow: BI.emptyFn
}) });
}, },
render: function () { render: function () {

10
src/base/combination/searcher.js

@ -24,7 +24,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
// isAutoSearch为false时启用 // isAutoSearch为false时启用
onSearch: function (op, callback) { onSearch: function (op, callback) {
callback([]) callback([]);
}, },
el: { el: {
@ -39,7 +39,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
masker: { // masker层 masker: { // masker层
offset: {} offset: {}
} }
}) });
}, },
_init: function () { _init: function () {
@ -79,7 +79,7 @@ BI.Searcher = BI.inherit(BI.Widget, {
self._pauseSearch(); self._pauseSearch();
break; break;
} }
}) });
}, },
_assertPopupView: function () { _assertPopupView: function () {
@ -268,9 +268,9 @@ BI.Searcher = BI.inherit(BI.Widget, {
return this.popupView.getValue(); return this.popupView.getValue();
} else if (o.adapter && o.adapter.getValue) { } else if (o.adapter && o.adapter.getValue) {
return o.adapter.getValue(); return o.adapter.getValue();
} else {
return this.popupView.getValue();
} }
return this.popupView.getValue();
}, },
populate: function (result, searchResult, keyword) { populate: function (result, searchResult, keyword) {

12
src/base/combination/switcher.js

@ -19,7 +19,7 @@ BI.Switcher = BI.inherit(BI.Widget, {
masker: {}, masker: {},
switcherClass: "bi-switcher-popup", switcherClass: "bi-switcher-popup",
hoverClass: "bi-switcher-hover" hoverClass: "bi-switcher-hover"
}) });
}, },
_init: function () { _init: function () {
@ -89,13 +89,13 @@ BI.Switcher = BI.inherit(BI.Widget, {
self.element[e](function (e) { self.element[e](function (e) {
if (self.isEnabled() && self.switcher.isEnabled()) { if (self.isEnabled() && self.switcher.isEnabled()) {
self._popupView(); self._popupView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_EXPAND); self.fireEvent(BI.Switcher.EVENT_EXPAND);
} }
}, function () { }, function () {
if (self.isEnabled() && self.switcher.isEnabled() && o.toggle) { if (self.isEnabled() && self.switcher.isEnabled() && o.toggle) {
self._hideView(); self._hideView();
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_COLLAPSE); self.fireEvent(BI.Switcher.EVENT_COLLAPSE);
} }
}); });
@ -107,10 +107,10 @@ BI.Switcher = BI.inherit(BI.Widget, {
if (self.isEnabled() && self.switcher.isEnabled()) { if (self.isEnabled() && self.switcher.isEnabled()) {
o.toggle ? self._toggle() : self._popupView(); o.toggle ? self._toggle() : self._popupView();
if (self.isExpanded()) { if (self.isExpanded()) {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, '', self.switcher); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_EXPAND); self.fireEvent(BI.Switcher.EVENT_EXPAND);
} else { } else {
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, '', self.switcher); self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.COLLAPSE, "", self.switcher);
self.fireEvent(BI.Switcher.EVENT_COLLAPSE); self.fireEvent(BI.Switcher.EVENT_COLLAPSE);
} }
} }
@ -119,7 +119,7 @@ BI.Switcher = BI.inherit(BI.Widget, {
} }
break; break;
} }
}) });
}, },
_initSwitcher: function () { _initSwitcher: function () {

4
src/base/combination/tab.js

@ -16,7 +16,7 @@ BI.Tab = BI.inherit(BI.Widget, {
cardCreator: function (v) { cardCreator: function (v) {
return BI.createWidget(); return BI.createWidget();
} }
}) });
}, },
render: function () { render: function () {
@ -25,7 +25,7 @@ BI.Tab = BI.inherit(BI.Widget, {
this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"}); this.tab = BI.createWidget(this.options.tab, {type: "bi.button_group"});
this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) { this.tab.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}) });
} }
this.cardMap = {}; this.cardMap = {};
this.layout = BI.createWidget({ this.layout = BI.createWidget({

2
src/base/combination/tree.button.js

@ -8,7 +8,7 @@ BI.ButtonTree = BI.inherit(BI.ButtonGroup, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-button-tree" baseCls: "bi-button-tree"
}) });
}, },
_init: function () { _init: function () {

4
src/base/el.js

@ -24,7 +24,7 @@ BI.EL = BI.inherit(BI.Widget, {
}); });
this.ele.on(BI.Controller.EVENT_CHANGE, function () { this.ele.on(BI.Controller.EVENT_CHANGE, function () {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}) });
}, },
setValue: function (v) { setValue: function (v) {
@ -39,4 +39,4 @@ BI.EL = BI.inherit(BI.Widget, {
this.ele.populate.apply(this, arguments); this.ele.populate.apply(this, arguments);
} }
}); });
BI.shortcut('bi.el', BI.EL); BI.shortcut("bi.el", BI.EL);

1228
src/base/formula/codemirror/codemirror.js

File diff suppressed because it is too large Load Diff

2
src/base/formula/codemirror/formula-hint.js

@ -64,7 +64,7 @@
return e.getTokenAt(cur); return e.getTokenAt(cur);
}, },
options); options);
}; }
CodeMirror.registerHelper("hint", "formula", formulaHint); CodeMirror.registerHelper("hint", "formula", formulaHint);
function getCompletions (token, context, keywords, options) { function getCompletions (token, context, keywords, options) {

10
src/base/formula/codemirror/formula-mode.js

@ -3,14 +3,14 @@
})(function (CodeMirror) { })(function (CodeMirror) {
"use strict"; "use strict";
CodeMirror.defineMode('formula', function () { CodeMirror.defineMode("formula", function () {
function wordObj (words) { function wordObj (words) {
var o = {}; var o = {};
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
return o; return o;
} }
var atoms = wordObj(['false', 'true']); var atoms = wordObj(["false", "true"]);
var keywords = wordObj(BI.FormulaCollections); var keywords = wordObj(BI.FormulaCollections);
function tokenBase (stream, state) { function tokenBase (stream, state) {
@ -19,16 +19,16 @@
} }
var ch = stream.next(); var ch = stream.next();
if (ch === '"' || ch === '\'') { if (ch === "\"" || ch === "'") {
nextUntilUnescaped(stream, ch); nextUntilUnescaped(stream, ch);
return "string"; return "string";
} }
if (ch === '\u200b') { if (ch === "\u200b") {
nextUntilUnescaped(stream, ch); nextUntilUnescaped(stream, ch);
return "field"; return "field";
} }
if (/[\[\],\(\)]/.test(ch)) { if (/[\[\],\(\)]/.test(ch)) {
return 'bracket'; return "bracket";
} }
// richie:暂时不需要解析操作符号 // richie:暂时不需要解析操作符号

55
src/base/formula/codemirror/show-hint.js

@ -140,17 +140,19 @@
var editor = this.cm.options.hintOptions; var editor = this.cm.options.hintOptions;
var out = {}; var out = {};
for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
if (editor) for (var prop in editor) if (editor) {
if (editor[prop] !== undefined) out[prop] = editor[prop]; for (var prop in editor) {if (editor[prop] !== undefined) out[prop] = editor[prop];}
if (options) for (var prop in options) }
if (options[prop] !== undefined) out[prop] = options[prop]; if (options) {
for (var prop in options) {if (options[prop] !== undefined) out[prop] = options[prop];}
}
return out; return out;
} }
}; };
function getText (completion) { function getText (completion) {
if (typeof completion == "string") return completion; if (typeof completion === "string") return completion;
else return completion.text; return completion.text;
} }
function buildKeyMap (completion, handle) { function buildKeyMap (completion, handle) {
@ -182,25 +184,27 @@
function addBinding (key, val) { function addBinding (key, val) {
var bound; var bound;
if (typeof val != "string") if (typeof val !== "string") {
bound = function (cm) { bound = function (cm) {
return val(cm, handle); return val(cm, handle);
}; };
}
// This mechanism is deprecated // This mechanism is deprecated
else if (baseMap.hasOwnProperty(val)) else if (baseMap.hasOwnProperty(val)) {bound = baseMap[val];} else {bound = val;}
bound = baseMap[val];
else
bound = val;
ourMap[key] = bound; ourMap[key] = bound;
} }
if (custom) if (custom) {
for (var key in custom) if (custom.hasOwnProperty(key)) for (var key in custom) {
addBinding(key, custom[key]); if (custom.hasOwnProperty(key)) {addBinding(key, custom[key]);}
}
}
var extra = completion.options.extraKeys; var extra = completion.options.extraKeys;
if (extra) if (extra) {
for (var key in extra) if (extra.hasOwnProperty(key)) for (var key in extra) {
addBinding(key, extra[key]); if (extra.hasOwnProperty(key)) {addBinding(key, extra[key]);}
}
}
return ourMap; return ourMap;
} }
@ -366,19 +370,13 @@
}, },
changeActive: function (i, avoidWrap) { changeActive: function (i, avoidWrap) {
if (i >= this.data.list.length) if (i >= this.data.list.length) {i = avoidWrap ? this.data.list.length - 1 : 0;} else if (i < 0) {i = avoidWrap ? 0 : this.data.list.length - 1;}
i = avoidWrap ? this.data.list.length - 1 : 0;
else if (i < 0)
i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return; if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint]; var node = this.hints.childNodes[this.selectedHint];
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node = this.hints.childNodes[this.selectedHint = i]; node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
if (node.offsetTop < this.hints.scrollTop) if (node.offsetTop < this.hints.scrollTop) {this.hints.scrollTop = node.offsetTop - 3;} else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) {this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;}
this.hints.scrollTop = node.offsetTop - 3;
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
}, },
@ -406,15 +404,16 @@
var found = []; var found = [];
for (var i = 0; i < options.words.length; i++) { for (var i = 0; i < options.words.length; i++) {
var word = options.words[i]; var word = options.words[i];
if (word.slice(0, token.string.length) == token.string) if (word.slice(0, token.string.length) == token.string) {found.push(word);}
found.push(word);
} }
if (found.length) return { if (found.length) {
return {
list: found, list: found,
from: CodeMirror.Pos(cur.line, token.start), from: CodeMirror.Pos(cur.line, token.start),
to: CodeMirror.Pos(cur.line, token.end) to: CodeMirror.Pos(cur.line, token.end)
}; };
}
}); });
CodeMirror.commands.autocomplete = CodeMirror.showHint; CodeMirror.commands.autocomplete = CodeMirror.showHint;

2
src/base/formula/config.js

File diff suppressed because one or more lines are too long

14
src/base/formula/formulaeditor.js

@ -6,9 +6,9 @@
BI.FormulaEditor = BI.inherit(BI.Single, { BI.FormulaEditor = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
return $.extend(BI.FormulaEditor.superclass._defaultConfig.apply(), { return $.extend(BI.FormulaEditor.superclass._defaultConfig.apply(), {
baseCls: 'bi-formula-editor bi-card', baseCls: "bi-formula-editor bi-card",
watermark: '', watermark: "",
value: '', value: "",
fieldTextValueMap: {}, fieldTextValueMap: {},
showHint: true, showHint: true,
lineHeight: 2 lineHeight: 2
@ -21,7 +21,7 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
textWrapping: true, textWrapping: true,
lineWrapping: true, lineWrapping: true,
lineNumbers: false, lineNumbers: false,
mode: 'formula', mode: "formula",
// 解决插入字段由括号或其他特殊字符包围时分裂的bug // 解决插入字段由括号或其他特殊字符包围时分裂的bug
specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/ specialChars: /[\u0000-\u001f\u007f\u00ad\u200c-\u200f\u2028\u2029\ufeff]/
}); });
@ -32,7 +32,7 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false}); CodeMirror.showHint(cm, CodeMirror.formulaHint, {completeSingle: false});
} }
BI.nextTick(function () { BI.nextTick(function () {
self.fireEvent(BI.FormulaEditor.EVENT_CHANGE) self.fireEvent(BI.FormulaEditor.EVENT_CHANGE);
}); });
}); });
@ -115,9 +115,9 @@ BI.FormulaEditor = BI.inherit(BI.Single, {
insertField: function (field) { insertField: function (field) {
var from = this.editor.getCursor(); var from = this.editor.getCursor();
// 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下 // 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + field + '\u200b'); this.editor.replaceSelection("\u200b" + field + "\u200b");
var to = this.editor.getCursor(); var to = this.editor.getCursor();
this.editor.markText(from, to, {className: 'fieldName', atomic: true, startStyle: "start", endStyle: "end"}); this.editor.markText(from, to, {className: "fieldName", atomic: true, startStyle: "start", endStyle: "end"});
this.editor.replaceSelection(" "); this.editor.replaceSelection(" ");
this.editor.focus(); this.editor.focus();
}, },

54
src/base/foundation/message.js

@ -43,28 +43,28 @@ $.extend(BI, {
BI.delay(function () { BI.delay(function () {
toast.element.slideUp(500, function () { toast.element.slideUp(500, function () {
toast.destroy(); toast.destroy();
}) });
}, 5000) }, 5000);
}) });
}, },
_show: function (hasCancel, title, message, callback) { _show: function (hasCancel, title, message, callback) {
$mask = $('<div class="bi-z-index-mask">').css({ $mask = $("<div class=\"bi-z-index-mask\">").css({
position: 'absolute', position: "absolute",
'zIndex': BI.zIndex_tip - 2, zIndex: BI.zIndex_tip - 2,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
opacity: 0.5 opacity: 0.5
}).appendTo('body'); }).appendTo("body");
$pop = $('<div class="bi-message-depend">').css({ $pop = $("<div class=\"bi-message-depend\">").css({
position: 'absolute', position: "absolute",
'zIndex': BI.zIndex_tip - 1, zIndex: BI.zIndex_tip - 1,
top: 0, top: 0,
left: 0, left: 0,
right: 0, right: 0,
bottom: 0 bottom: 0
}).appendTo('body'); }).appendTo("body");
var close = function () { var close = function () {
messageShow.destroy(); messageShow.destroy();
$mask.remove(); $mask.remove();
@ -73,10 +73,10 @@ $.extend(BI, {
if (hasCancel === true) { if (hasCancel === true) {
controlItems.push({ controlItems.push({
el: { el: {
type: 'bi.button', type: "bi.button",
text: BI.i18nText("BI-Basic_Cancel"), text: BI.i18nText("BI-Basic_Cancel"),
height: 30, height: 30,
level: 'ignore', level: "ignore",
handler: function () { handler: function () {
close(); close();
if (BI.isFunction(callback)) { if (BI.isFunction(callback)) {
@ -88,7 +88,7 @@ $.extend(BI, {
} }
controlItems.push({ controlItems.push({
el: { el: {
type: 'bi.button', type: "bi.button",
text: BI.i18nText("BI-Basic_OK"), text: BI.i18nText("BI-Basic_OK"),
height: 30, height: 30,
handler: function () { handler: function () {
@ -101,30 +101,30 @@ $.extend(BI, {
}); });
var conf = { var conf = {
element: $pop, element: $pop,
type: 'bi.center_adapt', type: "bi.center_adapt",
items: [ items: [
{ {
type: 'bi.border', type: "bi.border",
cls: 'bi-message-content bi-card', cls: "bi-message-content bi-card",
items: { items: {
'north': { north: {
el: { el: {
type: 'bi.border', type: "bi.border",
cls: 'bi-message-title bi-background', cls: "bi-message-title bi-background",
items: { items: {
center: { center: {
el: { el: {
type: 'bi.label', type: "bi.label",
text: title || BI.i18nText("BI-Basic_Prompt"), text: title || BI.i18nText("BI-Basic_Prompt"),
textAlign: 'left', textAlign: "left",
hgap: 20, hgap: 20,
height: 50 height: 50
} }
}, },
east: { east: {
el: { el: {
type: 'bi.icon_button', type: "bi.icon_button",
cls: 'bi-message-close close-font', cls: "bi-message-close close-font",
// height: 50, // height: 50,
handler: function () { handler: function () {
close(); close();
@ -136,7 +136,7 @@ $.extend(BI, {
}, },
height: 50 height: 50
}, },
'center': { center: {
el: { el: {
type: "bi.text", type: "bi.text",
cls: "bi-message-text", cls: "bi-message-text",
@ -147,12 +147,12 @@ $.extend(BI, {
text: message text: message
} }
}, },
'south': { south: {
el: { el: {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
el: { el: {
type: 'bi.right_vertical_adapt', type: "bi.right_vertical_adapt",
hgap: 5, hgap: 5,
items: controlItems items: controlItems
}, },

16
src/base/grid/grid.js

@ -73,7 +73,7 @@ BI.GridView = BI.inherit(BI.Widget, {
return { return {
overscanStartIndex: Math.max(0, startIndex - overscanCellsCount), overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),
overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount) overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)
} };
}, },
_calculateChildrenToRender: function () { _calculateChildrenToRender: function () {
@ -98,7 +98,7 @@ BI.GridView = BI.inherit(BI.Widget, {
this._renderedRowStartIndex = visibleRowIndices.start; this._renderedRowStartIndex = visibleRowIndices.start;
this._renderedRowStopIndex = visibleRowIndices.stop; this._renderedRowStopIndex = visibleRowIndices.stop;
var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex) var overscanColumnIndices = this._getOverscanIndices(this.columnCount, overscanColumnCount, this._renderedColumnStartIndex, this._renderedColumnStopIndex);
var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex); var overscanRowIndices = this._getOverscanIndices(this.rowCount, overscanRowCount, this._renderedRowStartIndex, this._renderedRowStopIndex);
@ -204,7 +204,7 @@ BI.GridView = BI.inherit(BI.Widget, {
}); });
var addedItems = []; var addedItems = [];
BI.each(addSet, function (index, key) { BI.each(addSet, function (index, key) {
addedItems.push(renderedCells[key[2]]) addedItems.push(renderedCells[key[2]]);
}); });
this.container.addItems(addedItems); this.container.addItems(addedItems);
// 拦截父子级关系 // 拦截父子级关系
@ -280,11 +280,11 @@ BI.GridView = BI.inherit(BI.Widget, {
}, },
setColumnCount: function (columnCount) { setColumnCount: function (columnCount) {
this.options.columnCount = columnCount this.options.columnCount = columnCount;
}, },
setRowCount: function (rowCount) { setRowCount: function (rowCount) {
this.options.rowCount = rowCount this.options.rowCount = rowCount;
}, },
setOverflowX: function (b) { setOverflowX: function (b) {
@ -292,7 +292,7 @@ BI.GridView = BI.inherit(BI.Widget, {
if (this.options.overflowX !== !!b) { if (this.options.overflowX !== !!b) {
this.options.overflowX = !!b; this.options.overflowX = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({overflowX: !!b ? "auto" : "hidden"}); self.element.css({overflowX: b ? "auto" : "hidden"});
}); });
} }
}, },
@ -302,7 +302,7 @@ BI.GridView = BI.inherit(BI.Widget, {
if (this.options.overflowY !== !!b) { if (this.options.overflowY !== !!b) {
this.options.overflowY = !!b; this.options.overflowY = !!b;
BI.nextTick(function () { BI.nextTick(function () {
self.element.css({overflowY: !!b ? "auto" : "hidden"}); self.element.css({overflowY: b ? "auto" : "hidden"});
}); });
} }
}, },
@ -360,4 +360,4 @@ BI.GridView = BI.inherit(BI.Widget, {
} }
}); });
BI.GridView.EVENT_SCROLL = "EVENT_SCROLL"; BI.GridView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut('bi.grid_view', BI.GridView); BI.shortcut("bi.grid_view", BI.GridView);

22
src/base/layer/layer.floatbox.js

@ -9,7 +9,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
baseCls: "bi-float-box bi-card", baseCls: "bi-float-box bi-card",
width: 600, width: 600,
height: 500 height: 500
}) });
}, },
_init: function () { _init: function () {
BI.FloatBox.superclass._init.apply(this, arguments); BI.FloatBox.superclass._init.apply(this, arguments);
@ -41,13 +41,13 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}); });
this._south = BI.createWidget(); this._south = BI.createWidget();
BI.createWidget({ BI.createWidget({
type: 'bi.border', type: "bi.border",
element: this, element: this,
items: { items: {
'north': { north: {
el: { el: {
type: 'bi.border', type: "bi.border",
cls: 'bi-message-title bi-background', cls: "bi-message-title bi-background",
items: { items: {
center: { center: {
el: { el: {
@ -63,8 +63,8 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
east: { east: {
el: { el: {
type: 'bi.icon_button', type: "bi.icon_button",
cls: 'bi-message-close close-font', cls: "bi-message-close close-font",
height: 50, height: 50,
handler: function () { handler: function () {
self.currentSectionProvider.close(); self.currentSectionProvider.close();
@ -76,7 +76,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}, },
height: 50 height: 50
}, },
'center': { center: {
el: { el: {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -88,7 +88,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}] }]
} }
}, },
'south': { south: {
el: { el: {
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
@ -102,7 +102,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
height: 60 height: 60
} }
} }
}) });
}, },
populate: function (sectionProvider) { populate: function (sectionProvider) {
@ -116,7 +116,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
sectionProvider.rebuildSouth(this._south); sectionProvider.rebuildSouth(this._south);
sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () { sectionProvider.on(BI.PopoverSection.EVENT_CLOSE, function () {
self.close(); self.close();
}) });
}, },
show: function () { show: function () {

18
src/base/layer/layer.popup.js

@ -7,7 +7,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-popup-view", baseCls: "bi-popup-view",
maxWidth: 'auto', maxWidth: "auto",
minWidth: 100, minWidth: 100,
// maxHeight: 200, // maxHeight: 200,
minHeight: 25, minHeight: 25,
@ -37,7 +37,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
type: "bi.vertical" type: "bi.vertical"
}] }]
} }
}) });
}, },
_init: function () { _init: function () {
@ -53,12 +53,12 @@ BI.PopupView = BI.inherit(BI.Widget, {
"z-index": BI.zIndex_popup, "z-index": BI.zIndex_popup,
"min-width": o.minWidth + "px", "min-width": o.minWidth + "px",
"max-width": o.maxWidth + "px" "max-width": o.maxWidth + "px"
}).bind({"click": fn}); }).bind({click: fn});
this.element.bind("mousewheel", fn); this.element.bind("mousewheel", fn);
o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); o.stopPropagation && this.element.bind({mousedown: fn, mouseup: fn, mouseover: fn});
o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); o.stopEvent && this.element.bind({mousedown: stop, mouseup: stop, mouseover: stop});
this.tool = this._createTool(); this.tool = this._createTool();
this.tab = this._createTab(); this.tab = this._createTab();
this.view = this._createView(); this.view = this._createView();
@ -103,7 +103,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
if (false === o.tool) { if (false === o.tool) {
return; return;
} }
return BI.createWidget(o.tool) return BI.createWidget(o.tool);
}, },
_createTab: function () { _createTab: function () {
@ -116,7 +116,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
cls: "list-view-tab", cls: "list-view-tab",
height: 25, height: 25,
items: o.tabs items: o.tabs
}) });
}, },
_createToolBar: function () { _createToolBar: function () {
@ -134,7 +134,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
shadow: true, shadow: true,
isShadowShowingOnSelected: true isShadowShowingOnSelected: true
}) })
}) });
}, },
getView: function () { getView: function () {
@ -155,7 +155,7 @@ BI.PopupView = BI.inherit(BI.Widget, {
tabHeight = this.tab ? (this.tab.attr("height") || 25) : 0, tabHeight = this.tab ? (this.tab.attr("height") || 25) : 0,
toolHeight = ((this.tool && this.tool.attr("height")) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0); toolHeight = ((this.tool && this.tool.attr("height")) || 25) * ((this.tool && this.tool.isVisible()) ? 1 : 0);
this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) : this.view.resetHeight ? this.view.resetHeight(h - tbHeight - tabHeight - toolHeight - 2) :
this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"}) this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"});
}, },
setValue: function (selectedValues) { setValue: function (selectedValues) {

2
src/base/layer/layer.searcher.js

@ -38,7 +38,7 @@ BI.SearcherView = BI.inherit(BI.Pane, {
type: "bi.vertical" type: "bi.vertical"
}] }]
} }
}) });
}, },
_init: function () { _init: function () {

4
src/base/list/listview.js

@ -35,7 +35,7 @@ BI.ListView = BI.inherit(BI.Widget, {
} }
}, o.el)], }, o.el)],
element: this element: this
} };
}, },
mounted: function () { mounted: function () {
@ -106,5 +106,5 @@ BI.ListView = BI.inherit(BI.Widget, {
this.restore(); this.restore();
} }
}); });
BI.shortcut('bi.list_view', BI.ListView); BI.shortcut("bi.list_view", BI.ListView);

4
src/base/list/virtuallist.js

@ -44,7 +44,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
} }
}], }],
element: this element: this
} };
}, },
mounted: function () { mounted: function () {
@ -175,5 +175,5 @@ BI.VirtualList = BI.inherit(BI.Widget, {
this.restore(); this.restore();
} }
}); });
BI.shortcut('bi.virtual_list', BI.VirtualList); BI.shortcut("bi.virtual_list", BI.VirtualList);

16
src/base/pager/pager.js

@ -38,7 +38,7 @@ BI.Pager = BI.inherit(BI.Widget, {
}, },
hasPrev: BI.emptyFn, // pages不可用时有效 hasPrev: BI.emptyFn, // pages不可用时有效
hasNext: BI.emptyFn // pages不可用时有效 hasNext: BI.emptyFn // pages不可用时有效
}) });
}, },
_init: function () { _init: function () {
BI.Pager.superclass._init.apply(this, arguments); BI.Pager.superclass._init.apply(this, arguments);
@ -81,7 +81,7 @@ BI.Pager = BI.inherit(BI.Widget, {
text: prev, text: prev,
value: "prev", value: "prev",
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
}) });
} else { } else {
view.push(BI.extend({ view.push(BI.extend({
disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false)
@ -126,12 +126,12 @@ BI.Pager = BI.inherit(BI.Widget, {
text: s, text: s,
value: s, value: s,
selected: true selected: true
}) });
} else { } else {
view.push({ view.push({
text: s, text: s,
value: s value: s
}) });
} }
} }
@ -148,7 +148,7 @@ BI.Pager = BI.inherit(BI.Widget, {
text: last, text: last,
value: "last", value: "last",
disabled: !(pages > groups && dict.end < pages && groups !== 0) disabled: !(pages > groups && dict.end < pages && groups !== 0)
}) });
} }
// 当前页不为尾页时,输出下一页 // 当前页不为尾页时,输出下一页
@ -157,18 +157,18 @@ BI.Pager = BI.inherit(BI.Widget, {
view.push((function () { view.push((function () {
if (BI.isKey(next)) { if (BI.isKey(next)) {
if (pages === false) { if (pages === false) {
return {text: next, value: "next", disabled: o.hasNext(curr) === false} return {text: next, value: "next", disabled: o.hasNext(curr) === false};
} }
return (dict.flow && curr === pages) return (dict.flow && curr === pages)
? ?
{text: next, value: "next", disabled: true} {text: next, value: "next", disabled: true}
: :
{text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)}; {text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)};
} else { }
return BI.extend({ return BI.extend({
disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow) disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow)
}, next); }, next);
}
}())); }()));
} }

6
src/base/pane.js

@ -14,7 +14,7 @@ BI.Pane = BI.inherit(BI.Widget, {
tipText: BI.i18nText("BI-No_Selected_Item"), tipText: BI.i18nText("BI-No_Selected_Item"),
overlap: true, overlap: true,
onLoaded: BI.emptyFn onLoaded: BI.emptyFn
}) });
}, },
_init: function () { _init: function () {
@ -44,7 +44,7 @@ BI.Pane = BI.inherit(BI.Widget, {
if (o.overlap === true) { if (o.overlap === true) {
if (!BI.Layers.has(this.getName())) { if (!BI.Layers.has(this.getName())) {
BI.createWidget({ BI.createWidget({
type: 'bi.vtape', type: "bi.vtape",
items: [{ items: [{
el: { el: {
type: "bi.layout", type: "bi.layout",
@ -72,7 +72,7 @@ BI.Pane = BI.inherit(BI.Widget, {
right: 0, right: 0,
top: 0 top: 0
}] }]
}) });
} }
}, },

2
src/base/single/a/a.js

@ -15,7 +15,7 @@ BI.A = BI.inherit(BI.Text, {
target: "_blank", target: "_blank",
el: null, el: null,
element: "<a/>" element: "<a/>"
}) });
}, },
_init: function () { _init: function () {
var o = this.options; var o = this.options;

16
src/base/single/bar/bar.loading.js

@ -7,10 +7,10 @@ BI.LoadingBar = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments); var conf = BI.LoadingBar.superclass._defaultConfig.apply(this, arguments);
return BI.extend( conf, { return BI.extend( conf, {
baseCls : (conf.baseCls ||"")+' bi-loading-bar bi-tips', baseCls: (conf.baseCls || "") + " bi-loading-bar bi-tips",
height: 30, height: 30,
handler: BI.emptyFn handler: BI.emptyFn
}) });
}, },
_init: function () { _init: function () {
BI.LoadingBar.superclass._init.apply(this, arguments); BI.LoadingBar.superclass._init.apply(this, arguments);
@ -21,25 +21,25 @@ BI.LoadingBar = BI.inherit(BI.Single, {
text: BI.i18nText("BI-Load_More"), text: BI.i18nText("BI-Load_More"),
width: 120, width: 120,
handler: this.options.handler handler: this.options.handler
}) });
this.loaded.on(BI.Controller.EVENT_CHANGE, function (type) { this.loaded.on(BI.Controller.EVENT_CHANGE, function (type) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
}) });
this.loading = BI.createWidget({ this.loading = BI.createWidget({
type: "bi.layout", type: "bi.layout",
width: this.options.height, width: this.options.height,
height: this.options.height, height: this.options.height,
cls: "loading-background cursor-default" cls: "loading-background cursor-default"
}) });
var loaded = BI.createWidget({ var loaded = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
items: [this.loaded] items: [this.loaded]
}) });
var loading = BI.createWidget({ var loading = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
items: [this.loading] items: [this.loading]
}) });
this.cardLayout = BI.createWidget({ this.cardLayout = BI.createWidget({
type: "bi.card", type: "bi.card",
element: this, element: this,
@ -50,7 +50,7 @@ BI.LoadingBar = BI.inherit(BI.Single, {
el: loading, el: loading,
cardName: "loading" cardName: "loading"
}] }]
}) });
this.invisible(); this.invisible();
}, },

2
src/base/single/button/button.basic.js

@ -24,7 +24,7 @@ BI.BasicButton = BI.inherit(BI.Single, {
isShadowShowingOnSelected: false, // 选中状态下是否显示阴影 isShadowShowingOnSelected: false, // 选中状态下是否显示阴影
trigger: null, trigger: null,
handler: BI.emptyFn handler: BI.emptyFn
}) });
}, },
_init: function () { _init: function () {
BI.BasicButton.superclass._init.apply(this, arguments); BI.BasicButton.superclass._init.apply(this, arguments);

4
src/base/single/button/button.node.js

@ -12,7 +12,7 @@ BI.NodeButton = BI.inherit(BI.BasicButton, {
return BI.extend( conf, { return BI.extend( conf, {
baseCls: (conf.baseCls || "") + " bi-node", baseCls: (conf.baseCls || "") + " bi-node",
open: false open: false
}) });
}, },
_init: function () { _init: function () {
@ -20,7 +20,7 @@ BI.NodeButton = BI.inherit(BI.BasicButton, {
var self = this; var self = this;
BI.nextTick(function () { BI.nextTick(function () {
self.setOpened(self.isOpened()); self.setOpened(self.isOpened());
}) });
}, },
doClick: function () { doClick: function () {

10
src/base/single/button/buttons/button.icon.js

@ -10,17 +10,17 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center", baseCls: (conf.baseCls || "") + " bi-icon-button horizon-center",
iconWidth: null, iconWidth: null,
iconHeight: null iconHeight: null
}) });
}, },
_init: function () { _init: function () {
BI.IconButton.superclass._init.apply(this, arguments); BI.IconButton.superclass._init.apply(this, arguments);
var o = this.options; var o = this.options;
this.element.css({ this.element.css({
textAlign: 'center' textAlign: "center"
}); });
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: 'bi.icon', type: "bi.icon",
width: o.iconWidth, width: o.iconWidth,
height: o.iconHeight height: o.iconHeight
}); });
@ -30,11 +30,11 @@ BI.IconButton = BI.inherit(BI.BasicButton, {
type: "bi.default", type: "bi.default",
element: this, element: this,
items: [this.icon] items: [this.icon]
}) });
} else { } else {
BI.createWidget({ BI.createWidget({
element: this, element: this,
type: 'bi.center_adapt', type: "bi.center_adapt",
items: [this.icon] items: [this.icon]
}); });
} }

6
src/base/single/button/buttons/button.image.js

@ -13,7 +13,7 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
src: "", src: "",
iconWidth: "100%", iconWidth: "100%",
iconHeight: "100%" iconHeight: "100%"
}) });
}, },
_init: function () { _init: function () {
@ -30,14 +30,14 @@ BI.ImageButton = BI.inherit(BI.BasicButton, {
type: "bi.center_adapt", type: "bi.center_adapt",
element: this, element: this,
items: [this.image] items: [this.image]
}) });
} else { } else {
BI.createWidget({ BI.createWidget({
type: "bi.adaptive", type: "bi.adaptive",
element: this, element: this,
items: [this.image], items: [this.image],
scrollable: false scrollable: false
}) });
} }
}, },

10
src/base/single/button/buttons/button.js

@ -13,13 +13,13 @@
_defaultConfig: function (props) { _defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
baseCls: (conf.baseCls || "") + ' bi-button', baseCls: (conf.baseCls || "") + " bi-button",
minWidth: (props.block === true || props.clear === true) ? 0 : 90, minWidth: (props.block === true || props.clear === true) ? 0 : 90,
shadow: props.clear !== true, shadow: props.clear !== true,
isShadowShowingOnSelected: true, isShadowShowingOnSelected: true,
readonly: true, readonly: true,
iconClass: "", iconClass: "",
level: 'common', level: "common",
block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制 block: false, // 是否块状显示,即不显示边框,没有最小宽度的限制
clear: false, // 是否去掉边框和背景 clear: false, // 是否去掉边框和背景
textAlign: "center", textAlign: "center",
@ -33,7 +33,7 @@
bgap: 0, bgap: 0,
lgap: 0, lgap: 0,
rgap: 0 rgap: 0
}) });
}, },
_init: function () { _init: function () {
@ -68,7 +68,7 @@
type: "bi.horizontal", type: "bi.horizontal",
items: [this.icon, this.text] items: [this.icon, this.text]
}] }]
}) });
} else { } else {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
@ -139,6 +139,6 @@
BI.Button.superclass.destroy.apply(this, arguments); BI.Button.superclass.destroy.apply(this, arguments);
} }
}); });
BI.shortcut('bi.button', BI.Button); BI.shortcut("bi.button", BI.Button);
BI.Button.EVENT_CHANGE = "EVENT_CHANGE"; BI.Button.EVENT_CHANGE = "EVENT_CHANGE";
})(jQuery); })(jQuery);

2
src/base/single/button/buttons/button.text.js

@ -20,7 +20,7 @@ BI.TextButton = BI.inherit(BI.BasicButton, {
rgap: 0, rgap: 0,
text: "", text: "",
py: "" py: ""
}) });
}, },
_init: function () { _init: function () {

4
src/base/single/button/listitem/blankiconicontextitem.js

@ -26,7 +26,7 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.BlankIconIconTextItem.superclass._init.apply(this, arguments); BI.BlankIconIconTextItem.superclass._init.apply(this, arguments);
@ -35,7 +35,7 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, {
type: "bi.layout", type: "bi.layout",
width: o.blankWidth, width: o.blankWidth,
height: o.height height: o.height
}) });
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "list-item-text", cls: "list-item-text",

8
src/base/single/button/listitem/blankicontexticonitem.js

@ -27,7 +27,7 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.BlankIconTextIconItem.superclass._init.apply(this, arguments); BI.BlankIconTextIconItem.superclass._init.apply(this, arguments);
@ -43,7 +43,7 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
var icon1 = BI.createWidget({ var icon1 = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
@ -57,7 +57,7 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
height: o.iconHeight height: o.iconHeight
} }
}] }]
}) });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -79,7 +79,7 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, {
bottom: 0, bottom: 0,
right: 0 right: 0
}] }]
}) });
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
element: this element: this

6
src/base/single/button/listitem/blankicontextitem.js

@ -25,7 +25,7 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.BlankIconTextItem.superclass._init.apply(this, arguments); BI.BlankIconTextItem.superclass._init.apply(this, arguments);
@ -33,7 +33,7 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
var blank = BI.createWidget({ var blank = BI.createWidget({
type: "bi.layout", type: "bi.layout",
width: o.blankWidth width: o.blankWidth
}) });
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
cls: "list-item-text", cls: "list-item-text",
@ -46,7 +46,7 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
width: c.commonWidth, width: c.commonWidth,

10
src/base/single/button/listitem/icontexticonitem.js

@ -26,7 +26,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.IconTextIconItem.superclass._init.apply(this, arguments); BI.IconTextIconItem.superclass._init.apply(this, arguments);
@ -42,7 +42,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
var icon1 = BI.createWidget({ var icon1 = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
@ -56,11 +56,11 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
height: o.iconHeight height: o.iconHeight
} }
}] }]
}) });
var blank = BI.createWidget({ var blank = BI.createWidget({
type: "bi.layout", type: "bi.layout",
width: c.commonWidth width: c.commonWidth
}) });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -81,7 +81,7 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, {
bottom: 0, bottom: 0,
right: 0 right: 0
}] }]
}) });
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
element: this element: this

2
src/base/single/button/listitem/icontextitem.js

@ -24,7 +24,7 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.IconTextItem.superclass._init.apply(this, arguments); BI.IconTextItem.superclass._init.apply(this, arguments);

2
src/base/single/button/listitem/texticonitem.js

@ -25,7 +25,7 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.TextIconItem.superclass._init.apply(this, arguments); BI.TextIconItem.superclass._init.apply(this, arguments);

2
src/base/single/button/listitem/textitem.js

@ -18,7 +18,7 @@ BI.TextItem = BI.inherit(BI.BasicButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.TextItem.superclass._init.apply(this, arguments); BI.TextItem.superclass._init.apply(this, arguments);

10
src/base/single/button/node/icontexticonnode.js

@ -24,7 +24,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.IconTextIconNode.superclass._init.apply(this, arguments); BI.IconTextIconNode.superclass._init.apply(this, arguments);
@ -40,7 +40,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
var icon1 = BI.createWidget({ var icon1 = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
@ -54,12 +54,12 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
height: o.iconHeight height: o.iconHeight
} }
}] }]
}) });
var blank = BI.createWidget({ var blank = BI.createWidget({
type: "bi.layout", type: "bi.layout",
width: c.commonWidth, width: c.commonWidth,
height: o.height height: o.height
}) });
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -80,7 +80,7 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, {
bottom: 0, bottom: 0,
right: 0 right: 0
}] }]
}) });
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
element: this element: this

6
src/base/single/button/node/icontextnode.js

@ -23,7 +23,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.IconTextNode.superclass._init.apply(this, arguments); BI.IconTextNode.superclass._init.apply(this, arguments);
@ -40,7 +40,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
width: c.commonWidth, width: c.commonWidth,
@ -52,7 +52,7 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, {
height: o.iconHeight height: o.iconHeight
} }
}] }]
}) });
BI.createWidget(BI.extend({ BI.createWidget(BI.extend({
element: this element: this

4
src/base/single/button/node/texticonnode.js

@ -22,7 +22,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.TextIconNode.superclass._init.apply(this, arguments); BI.TextIconNode.superclass._init.apply(this, arguments);
@ -39,7 +39,7 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, {
value: o.value, value: o.value,
keyword: o.keyword, keyword: o.keyword,
height: o.height height: o.height
}) });
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.center_adapt", type: "bi.center_adapt",
width: c.commonWidth, width: c.commonWidth,

2
src/base/single/button/node/textnode.js

@ -17,7 +17,7 @@ BI.TextNode = BI.inherit(BI.NodeButton, {
textVgap: 0, textVgap: 0,
textLgap: 0, textLgap: 0,
textRgap: 0 textRgap: 0
}) });
}, },
_init: function () { _init: function () {
BI.TextNode.superclass._init.apply(this, arguments); BI.TextNode.superclass._init.apply(this, arguments);

14
src/base/single/editor/editor.code.js

@ -7,8 +7,8 @@
BI.CodeEditor = BI.inherit(BI.Single, { BI.CodeEditor = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), { return $.extend(BI.CodeEditor.superclass._defaultConfig.apply(), {
baseCls: 'bi-code-editor', baseCls: "bi-code-editor",
value: '', value: "",
watermark: "", watermark: "",
lineHeight: 2, lineHeight: 2,
readOnly: false, readOnly: false,
@ -32,7 +32,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height"); o.lineHeight === 1 ? this.element.addClass("codemirror-low-line-height") : this.element.addClass("codemirror-high-line-height");
this.editor.on("change", function (cm, change) { this.editor.on("change", function (cm, change) {
BI.nextTick(function () { BI.nextTick(function () {
self.fireEvent(BI.CodeEditor.EVENT_CHANGE) self.fireEvent(BI.CodeEditor.EVENT_CHANGE);
}); });
}); });
@ -96,7 +96,7 @@ BI.CodeEditor = BI.inherit(BI.Single, {
_setEnable: function (b) { _setEnable: function (b) {
BI.CodeEditor.superclass._setEnable.apply(this, arguments); BI.CodeEditor.superclass._setEnable.apply(this, arguments);
this.editor.setOption("readOnly", b === true ? false : "nocursor") this.editor.setOption("readOnly", b === true ? false : "nocursor");
}, },
_checkWaterMark: function () { _checkWaterMark: function () {
@ -113,11 +113,11 @@ BI.CodeEditor = BI.inherit(BI.Single, {
param = this.options.paramFormatter(param); param = this.options.paramFormatter(param);
var from = this.editor.getCursor(); var from = this.editor.getCursor();
// 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下 // 解决插入字段由括号或其他特殊字符包围时分裂的bug,在两端以不可见字符包裹一下
this.editor.replaceSelection('\u200b' + param + '\u200b'); this.editor.replaceSelection("\u200b" + param + "\u200b");
var to = this.editor.getCursor(); var to = this.editor.getCursor();
var options = {className: 'param', atomic: true}; var options = {className: "param", atomic: true};
if (BI.isNotNull(param.match(/^<!.*!>$/))) { if (BI.isNotNull(param.match(/^<!.*!>$/))) {
options.className = 'error-param'; options.className = "error-param";
} }
options.value = value; options.value = value;
this.editor.markText(from, to, options); this.editor.markText(from, to, options);

14
src/base/single/editor/editor.js

@ -22,7 +22,7 @@ BI.Editor = BI.inherit(BI.Single, {
allowBlank: false, allowBlank: false,
watermark: "", watermark: "",
errorText: "" errorText: ""
}) });
}, },
_init: function () { _init: function () {
@ -38,12 +38,12 @@ BI.Editor = BI.inherit(BI.Single, {
allowBlank: o.allowBlank allowBlank: o.allowBlank
})); }));
this.editor.element.css({ this.editor.element.css({
"width": "100%", width: "100%",
"height": "100%", height: "100%",
"border": "none", border: "none",
"outline": "none", outline: "none",
"padding": "0", padding: "0",
"margin": "0" margin: "0"
}); });
if (BI.isKey(this.options.watermark)) { if (BI.isKey(this.options.watermark)) {
this.watermark = BI.createWidget({ this.watermark = BI.createWidget({

2
src/base/single/editor/editor.multifile.js

@ -15,7 +15,7 @@ BI.MultifileEditor = BI.inherit(BI.Single, {
maxSize: -1, // 1024 * 1024 maxSize: -1, // 1024 * 1024
accept: "", accept: "",
url: "" url: ""
}) });
}, },
_init: function () { _init: function () {

12
src/base/single/editor/editor.textarea.js

@ -7,8 +7,8 @@
BI.TextAreaEditor = BI.inherit(BI.Single, { BI.TextAreaEditor = BI.inherit(BI.Single, {
_defaultConfig: function () { _defaultConfig: function () {
return $.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(), { return $.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(), {
baseCls: 'bi-textarea-editor bi-card', baseCls: "bi-textarea-editor bi-card",
value: '' value: ""
}); });
}, },
_init: function () { _init: function () {
@ -21,7 +21,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
height: "100%", height: "100%",
cls: "bi-textarea textarea-editor-content display-block" cls: "bi-textarea textarea-editor-content display-block"
}); });
this.content.element.css({"resize": "none"}); this.content.element.css({resize: "none"});
BI.createWidget({ BI.createWidget({
type: "bi.absolute", type: "bi.absolute",
element: this, element: this,
@ -92,7 +92,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
self.focus(); self.focus();
}); });
BI.createWidget({ BI.createWidget({
type: 'bi.absolute', type: "bi.absolute",
element: this, element: this,
items: [{ items: [{
el: this.watermark, el: this.watermark,
@ -100,7 +100,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
top: 0, top: 0,
right: 0 right: 0
}] }]
}) });
} else { } else {
this.watermark.setText(o.watermark); this.watermark.setText(o.watermark);
this.watermark.setValid(!o.invalid); this.watermark.setValid(!o.invalid);
@ -144,7 +144,7 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
this.element.css(style); this.element.css(style);
this.content.element.css(BI.extend({}, style, { this.content.element.css(BI.extend({}, style, {
color: style.color || BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor) ? BI.DOM.rgb2hex(style.backgroundColor) : style.backgroundColor) color: style.color || BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor) ? BI.DOM.rgb2hex(style.backgroundColor) : style.backgroundColor)
})) }));
}, },
getStyle: function () { getStyle: function () {

2
src/base/single/icon/icon.js

@ -9,7 +9,7 @@ BI.Icon = BI.inherit(BI.Single, {
return BI.extend(conf, { return BI.extend(conf, {
tagName: "i", tagName: "i",
baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block" baseCls: (conf.baseCls || "") + " x-icon b-font horizon-center display-block"
}) });
}, },
_init: function () { _init: function () {
BI.Icon.superclass._init.apply(this, arguments); BI.Icon.superclass._init.apply(this, arguments);

6
src/base/single/iframe/iframe.js

@ -12,7 +12,7 @@ BI.Iframe = BI.inherit(BI.Single, {
src: "", src: "",
width: "100%", width: "100%",
height: "100%" height: "100%"
}) });
}, },
_init: function () { _init: function () {
@ -40,11 +40,11 @@ BI.Iframe = BI.inherit(BI.Single, {
}, },
getWidth: function () { getWidth: function () {
return this.options.width return this.options.width;
}, },
getHeight: function () { getHeight: function () {
return this.options.height return this.options.height;
} }
}); });

2
src/base/single/img/img.js

@ -14,7 +14,7 @@ BI.Img = BI.inherit(BI.Single, {
src: "", src: "",
width: "100%", width: "100%",
height: "100%" height: "100%"
}) });
}, },
_init: function () { _init: function () {

2
src/base/single/input/checkbox.js

@ -14,7 +14,7 @@ BI.Checkbox = BI.inherit(BI.IconButton, {
height: 16, height: 16,
iconWidth: 16, iconWidth: 16,
iconHeight: 16 iconHeight: 16
}) });
}, },
_init: function () { _init: function () {

2
src/base/single/input/input.js

@ -13,7 +13,7 @@ BI.Input = BI.inherit(BI.Single, {
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn, // 按确定键能否退出编辑 quitChecker: BI.emptyFn, // 按确定键能否退出编辑
allowBlank: false allowBlank: false
}) });
}, },
_init: function () { _init: function () {

2
src/base/single/input/radio.js

@ -14,7 +14,7 @@ BI.Radio = BI.inherit(BI.IconButton, {
height: 16, height: 16,
iconWidth: 16, iconWidth: 16,
iconHeight: 16 iconHeight: 16
}) });
}, },
_init: function () { _init: function () {

10
src/base/single/label/label.js

@ -21,7 +21,7 @@ BI.Label = BI.inherit(BI.Single, {
text: "", text: "",
py: "", py: "",
keyword: "" keyword: ""
}) });
}, },
_createJson: function () { _createJson: function () {
@ -226,7 +226,7 @@ BI.Label = BI.inherit(BI.Single, {
type: "bi.layout", type: "bi.layout",
element: this.text, element: this.text,
scrollable: o.whiteSpace === "normal" scrollable: o.whiteSpace === "normal"
}) });
}, },
_createNotCenterEl: function () { _createNotCenterEl: function () {
@ -344,7 +344,7 @@ BI.Label = BI.inherit(BI.Single, {
return; return;
} }
if (o.whiteSpace == "normal") { if (o.whiteSpace == "normal") {
this.text = BI.createWidget(json) this.text = BI.createWidget(json);
BI.createWidget({ BI.createWidget({
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
scrollable: o.whiteSpace === "normal", scrollable: o.whiteSpace === "normal",
@ -424,7 +424,7 @@ BI.Label = BI.inherit(BI.Single, {
type: "bi.layout", type: "bi.layout",
element: this.text, element: this.text,
scrollable: o.whiteSpace === "normal" scrollable: o.whiteSpace === "normal"
}) });
}, },
doRedMark: function () { doRedMark: function () {
@ -453,7 +453,7 @@ BI.Label = BI.inherit(BI.Single, {
}, },
setStyle: function (css) { setStyle: function (css) {
this.text.setStyle(css) this.text.setStyle(css);
}, },
setValue: function (v) { setValue: function (v) {

2
src/base/single/link/link.js

@ -10,7 +10,7 @@ BI.Link = BI.inherit(BI.Label, {
baseCls: (conf.baseCls || "") + " bi-link", baseCls: (conf.baseCls || "") + " bi-link",
href: "", href: "",
target: "_blank" target: "_blank"
}) });
}, },
_createJson: function () { _createJson: function () {

2
src/base/single/single.js

@ -19,7 +19,7 @@ BI.Single = BI.inherit(BI.Widget, {
warningTitle: null, warningTitle: null,
tipType: null, // success或warning tipType: null, // success或warning
value: null value: null
}) });
}, },
_showToolTip: function (e, opt) { _showToolTip: function (e, opt) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save