Skip to content

Commit d448d19

Browse files
author
luoxiao
committed
【fix】 修改图表微件的type报错 review by zhurc
1 parent e962747 commit d448d19

17 files changed

+160
-105
lines changed

dist/classic/iclient-classic-es6.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63444,9 +63444,11 @@ class ChartView_ChartView {
6344463444
let messageboxs = new MessageBox_MessageBox();
6344563445
//iclient9 绑定createChart事件成功回调
6344663446
this.viewModel.getDatasetInfo(this._createChart.bind(this));
63447-
this.viewModel.events.on({"getdatafailed": (error) => {
63448-
messageboxs.showView(error.message);
63449-
}});
63447+
this.viewModel.events.on({
63448+
"getdatafailed": (error) => {
63449+
messageboxs.showView(error.message);
63450+
}
63451+
});
6345063452
}
6345163453

6345263454
/**
@@ -63481,11 +63483,13 @@ class ChartView_ChartView {
6348163483
* @param {string} type - 图表类型
6348263484
*/
6348363485
changeType(type) {
63484-
this.chartType = type;
63485-
let newOptions = this.viewModel.changeType(type);
63486-
this._updateChart(newOptions);
63486+
if (this.chartType !== type) {
63487+
this.chartType = type;
63488+
let newOptions = this.viewModel.changeType(type);
63489+
this._updateChart(newOptions);
63490+
}
6348763491
}
63488-
63492+
6348963493
/**
6349063494
* @function SuperMap.Widgets.Chart.prototype.updateData
6349163495
* @description 更新图表数据
@@ -63494,9 +63498,9 @@ class ChartView_ChartView {
6349463498
*/
6349563499
updateData(datasets, chartOption) {
6349663500
let me = this;
63497-
this.viewModel.updateData(datasets, chartOption, function(options) {
63501+
this.viewModel.updateData(datasets, chartOption, function (options) {
6349863502
me._updateChart(options);
63499-
if(me.addChart) {
63503+
if (me.addChart) {
6350063504
me.addChart();
6350163505
}
6350263506
});
@@ -63510,13 +63514,14 @@ class ChartView_ChartView {
6351063514
*/
6351163515
_createChart(data) {
6351263516
this.echart = external_function_try_return_echarts_catch_e_return_default.a.init(
63513-
document.getElementById(this.domID),
63514-
null,
63515-
{ renderer: "canvas"}
63517+
document.getElementById(this.domID),
63518+
null, {
63519+
renderer: "canvas"
63520+
}
6351663521
)
6351763522
let options = this.viewModel._createChartOptions(data);
6351863523
this.echart.setOption(options);
63519-
if(this.addChart) {
63524+
if (this.addChart) {
6352063525
this.addChart();
6352163526
}
6352263527
}
@@ -63528,7 +63533,7 @@ class ChartView_ChartView {
6352863533
* @param {Object} options - 图表参数
6352963534
*/
6353063535
_updateChart(options) {
63531-
if(this.echart) {
63536+
if (this.echart) {
6353263537
this.echart.clear();
6353363538
this.echart.setOption(options);
6353463539
}

dist/classic/iclient-classic-es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/classic/iclient-classic.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79218,9 +79218,11 @@ var ChartView = exports.ChartView = function () {
7921879218
var messageboxs = new _MessageBox.MessageBox();
7921979219
//iclient9 绑定createChart事件成功回调
7922079220
this.viewModel.getDatasetInfo(this._createChart.bind(this));
79221-
this.viewModel.events.on({ "getdatafailed": function getdatafailed(error) {
79221+
this.viewModel.events.on({
79222+
"getdatafailed": function getdatafailed(error) {
7922279223
messageboxs.showView(error.message);
79223-
} });
79224+
}
79225+
});
7922479226
}
7922579227

7922679228
/**
@@ -79267,9 +79269,11 @@ var ChartView = exports.ChartView = function () {
7926779269
}, {
7926879270
key: "changeType",
7926979271
value: function changeType(type) {
79270-
this.chartType = type;
79271-
var newOptions = this.viewModel.changeType(type);
79272-
this._updateChart(newOptions);
79272+
if (this.chartType !== type) {
79273+
this.chartType = type;
79274+
var newOptions = this.viewModel.changeType(type);
79275+
this._updateChart(newOptions);
79276+
}
7927379277
}
7927479278

7927579279
/**
@@ -79301,7 +79305,9 @@ var ChartView = exports.ChartView = function () {
7930179305
}, {
7930279306
key: "_createChart",
7930379307
value: function _createChart(data) {
79304-
this.echart = _echarts2.default.init(document.getElementById(this.domID), null, { renderer: "canvas" });
79308+
this.echart = _echarts2.default.init(document.getElementById(this.domID), null, {
79309+
renderer: "canvas"
79310+
});
7930579311
var options = this.viewModel._createChartOptions(data);
7930679312
this.echart.setOption(options);
7930779313
if (this.addChart) {

0 commit comments

Comments
 (0)