From 52c6c3427a64988dd7eb01551d29296918f80592 Mon Sep 17 00:00:00 2001 From: Davont Date: Tue, 25 Jun 2024 20:46:10 -0700 Subject: [PATCH] fix(chart): [chart] Fixed baidu chart example and chart-core bug (#1691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 【Charts】update charts snapshots * fix: 修复图表height为100%时的高度问题 * fix: 优化图表extend逻辑 * fix: 修复图表extend失效问题 * fix: 删除注释 * fix: 新增图表echartOption变量,以便用户获取echart配置 * fix: 修复playground百度地图案例错误问题 * fix: 修复图表option复杂变量失效问题 * fix: 修改高德百度地图案例注释 --- .../sites/demos/pc/app/chart/amap/base-composition-api.vue | 2 +- examples/sites/demos/pc/app/chart/amap/base.vue | 2 +- examples/sites/demos/pc/app/chart/bmap/base.vue | 4 ++-- packages/vue/src/chart/chart-core/src/chart-core.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/sites/demos/pc/app/chart/amap/base-composition-api.vue b/examples/sites/demos/pc/app/chart/amap/base-composition-api.vue index 0d8b1843a3..eac3646f8c 100644 --- a/examples/sites/demos/pc/app/chart/amap/base-composition-api.vue +++ b/examples/sites/demos/pc/app/chart/amap/base-composition-api.vue @@ -10,7 +10,7 @@ import { AutonaviMap as TinyAutonaviMap } from '@opentiny/vue' const options = ref({ key: '4b5f2cf2cba25200cc6b68c398468899', - url: 'https://webapi.amap.com/maps', // 谷歌地图接口的url地址 + url: 'https://webapi.amap.com/maps', // 高德地图接口的url地址 v: '1.4.3', amap: { resizeEnable: true, diff --git a/examples/sites/demos/pc/app/chart/amap/base.vue b/examples/sites/demos/pc/app/chart/amap/base.vue index 3fd3543e61..241eb15830 100644 --- a/examples/sites/demos/pc/app/chart/amap/base.vue +++ b/examples/sites/demos/pc/app/chart/amap/base.vue @@ -15,7 +15,7 @@ export default { return { options: { key: '4b5f2cf2cba25200cc6b68c398468899', - url: 'https://webapi.amap.com/maps', // 谷歌地图接口的url地址 + url: 'https://webapi.amap.com/maps', // 高德地图接口的url地址 v: '1.4.3', amap: { resizeEnable: true, diff --git a/examples/sites/demos/pc/app/chart/bmap/base.vue b/examples/sites/demos/pc/app/chart/bmap/base.vue index c1b33108b8..2e5dadaebb 100644 --- a/examples/sites/demos/pc/app/chart/bmap/base.vue +++ b/examples/sites/demos/pc/app/chart/bmap/base.vue @@ -14,8 +14,8 @@ export default { data() { return { options: { - key: '4b5f2cf2cba25200cc6b68c398468899', - url: 'https://webapi.amap.com/maps', // 谷歌地图接口的url地址 + key: 'oBvDtR6nzWtVchkY4cLHtnah1VVZQKRK', + url: 'https://api.map.baidu.com/api', // 百度地图接口的url地址 v: '1.4.3', bmap: { resizeEnable: true, diff --git a/packages/vue/src/chart/chart-core/src/chart-core.ts b/packages/vue/src/chart/chart-core/src/chart-core.ts index e6f113850b..ad3a398de1 100644 --- a/packages/vue/src/chart/chart-core/src/chart-core.ts +++ b/packages/vue/src/chart/chart-core/src/chart-core.ts @@ -340,7 +340,7 @@ export default { if (Object.keys(this.options).length === 0) { this.updateChart(data) } else { - this.option = JSON.parse(JSON.stringify(this.options)) + this.option = cloneDeep(this.options) } let { option } = this clearTimeout(this.timer) @@ -527,7 +527,7 @@ export default { if (Object.keys(this.options).length === 0) { this.updateChart(data) } else { - this.option = { ...this.options } + this.option = cloneDeep(this.options) } let { option } = this option = this.afterConfigFn(option)