Skip to content

Commit fc2ad38

Browse files
committed
fix: fix chart dataZoom bug
1 parent 5625449 commit fc2ad38

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/vue/src/huicharts/huicharts-core/common/extend.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ export default ({ huiChartOption, extend }) => {
5353
]
5454
if (~attrList.indexOf(key)) {
5555
// attrList,指定的key才能合并处理
56-
mergeOption[key] = merge(mergeOption[key], value)
56+
if (key === 'dataZoom') {
57+
mergeOption[key] = value
58+
} else {
59+
mergeOption[key] = merge(mergeOption[key], value)
60+
}
5761
}
5862
} else {
5963
// 属性为对象(eg: tooltip)或包含对象的数组(eg: series)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,13 @@ export default {
369369
this.selfSetting(huiChartOption)
370370
this.setAnimation(huiChartOption)
371371
this.applyMarks(this.integrateChart.eChartOption)
372-
this.integrateChart.refresh(huiChartOption)
372+
this.integrateChart.refresh(cloneDeep(huiChartOption))
373373
if (this.colorMode !== 'default') {
374374
huiChartOption.color = this.computedChartColor()
375375
}
376376
if (this.extend && Object.keys(this.extend).length !== 0) {
377377
huiChartOption.extend = this.applyExtend(this.integrateChart.eChartOption)
378-
this.integrateChart.refresh(huiChartOption)
378+
this.integrateChart.refresh(cloneDeep(huiChartOption))
379379
}
380380
this.$emit('handle-color', huiChartOption.color)
381381
if (this.afterSetOption) {
@@ -419,15 +419,15 @@ export default {
419419
if (this.colorMode !== 'default') {
420420
huiChartOption.color = this.computedChartColor()
421421
}
422-
this.integrateChart.setSimpleOption(this.iChartName, huiChartOption, plugins)
422+
this.integrateChart.setSimpleOption(this.iChartName, cloneDeep(huiChartOption), plugins)
423423
this.$emit('handle-color', huiChartOption.color)
424424
this.applyMarks(this.integrateChart.eChartOption)
425425
}
426426

427427
// 判断extend,将extend放入配置项中
428428
if (this.extend && Object.keys(this.extend).length !== 0) {
429429
huiChartOption.extend = this.applyExtend(this.integrateChart.eChartOption)
430-
this.integrateChart.setSimpleOption(this.iChartName, huiChartOption, plugins)
430+
this.integrateChart.setSimpleOption(this.iChartName, cloneDeep(huiChartOption), plugins)
431431
}
432432
this.integrateChart.render(this.renderOption)
433433

0 commit comments

Comments
 (0)