提交 f219ba48 编写于 作者: K kener

组件代码优化

上级 8941c089
...@@ -108,11 +108,11 @@ define(function (require) { ...@@ -108,11 +108,11 @@ define(function (require) {
* 构造函数默认执行的初始化方法,也用于创建实例后动态修改 * 构造函数默认执行的初始化方法,也用于创建实例后动态修改
* @param {Object} newZr * @param {Object} newZr
* @param {Object} newOption * @param {Object} newOption
* @param {Object} newCompoent * @param {Object} newComponent
*/ */
init : function (newOption, newCompoent, newAxisType) { init : function (newOption, newComponent, newAxisType) {
this.option = newOption || this.option; this.option = newOption || this.option;
this.component = newCompoent || this.component; this.component = newComponent || this.component;
this.axisType = newAxisType || this.axisType; this.axisType = newAxisType || this.axisType;
this._axisList = []; this._axisList = [];
......
...@@ -147,7 +147,10 @@ define(function (require) { ...@@ -147,7 +147,10 @@ define(function (require) {
return interval; return interval;
}, },
/**
* 绘制图形
*/
_buildShape : function () { _buildShape : function () {
// 标签文字格式化 // 标签文字格式化
this._labelData = this._reformLabel(); this._labelData = this._reformLabel();
......
...@@ -60,7 +60,6 @@ define(function (require) { ...@@ -60,7 +60,6 @@ define(function (require) {
this.option = newOption; this.option = newOption;
this._tDom.innerHTML = '<p style="padding:8px 0;margin:0 0 10px 0;' this._tDom.innerHTML = '<p style="padding:8px 0;margin:0 0 10px 0;'
+ 'border-bottom:1px solid #eee">' + 'border-bottom:1px solid #eee">'
+ (lang[0] || this._lang[0]) + (lang[0] || this._lang[0])
......
...@@ -1010,8 +1010,8 @@ define(function (require) { ...@@ -1010,8 +1010,8 @@ define(function (require) {
}, },
init : function (newOption, newComponent) { init : function (newOption, newComponent) {
this.option = newOption; this.option = newOption || this.option;
this.component = newComponent; this.component = newComponent || this.component;
this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽
this._handleSize = 8; // 手柄大小 this._handleSize = 8; // 手柄大小
......
...@@ -81,7 +81,6 @@ define(function (require) { ...@@ -81,7 +81,6 @@ define(function (require) {
) { ) {
this.clear(); this.clear();
this.option = newOption || this.option; this.option = newOption || this.option;
this.option.grid = this.reformOption(this.option.grid); this.option.grid = this.reformOption(this.option.grid);
var gridOption = this.option.grid; var gridOption = this.option.grid;
......
...@@ -899,8 +899,8 @@ define(function (require) { ...@@ -899,8 +899,8 @@ define(function (require) {
* 刷新 * 刷新
*/ */
refresh : function (newOption) { refresh : function (newOption) {
if (newOption || newComponent) { if (newOption) {
this.option = newOption || this.option; this.option = newOption;
this.polar = this.option.polar; this.polar = this.option.polar;
this.series = this.option.series; this.series = this.option.series;
} }
......
...@@ -1049,8 +1049,8 @@ define(function (require) { ...@@ -1049,8 +1049,8 @@ define(function (require) {
newOption.toolbox.padding = this.reformCssArray( newOption.toolbox.padding = this.reformCssArray(
newOption.toolbox.padding newOption.toolbox.padding
); );
this.option = newOption; this.option = newOption || this.option;
this.component = newComponent; this.component = newComponent || this.component;
this.shapeList = []; this.shapeList = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册