Skip to content

Commit 709f41c

Browse files
[fix]vue3 chart.js
1 parent f550afe commit 709f41c

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

vue3/packages/common/hooks/useChart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
getMultiColorGroup,
88
chartThemeUtil,
99
handleMultiGradient
10-
} from 'vue-iclient-core/utils/style/theme/chart'
10+
} from '@supermapgis/common/utils/theme/chart'
1111
import EchartsDataService from 'vue-iclient-core/utils/EchartsDataService'
1212
import {
1313
getFeatureCenter,

core/utils/style/theme/chart.js renamed to vue3/packages/common/utils/theme/chart.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { getColorWithOpacity } from 'vue-iclient-core/utils/util';
22
import cloneDeep from 'lodash.clonedeep';
3-
import { ColorsPickerUtil } from 'vue-iclient-static/libs/iclient-common/iclient-common'
3+
import { ColorsPickerUtil } from 'vue-iclient-static/libs/iclient-common/iclient-common';
44

55
export const handleMultiGradient = (colorGroupsData, dataLength) => {
66
let startColors = [];
@@ -150,7 +150,11 @@ export const chartThemeUtil = (
150150
// 坐标轴线
151151
lineStyle: {
152152
// 属性lineStyle控制线条样式
153-
color: [[0.2, colorGroup[0]], [0.8, colorGroup[1]], [1, colorGroup[2]]]
153+
color: [
154+
[0.2, colorGroup[0]],
155+
[0.8, colorGroup[1]],
156+
[1, colorGroup[2]]
157+
]
154158
}
155159
},
156160
itemStyle: {
@@ -379,15 +383,21 @@ export const chartThemeUtil = (
379383
},
380384
itemStyle: {
381385
color: '#626c91',
382-
borderWidth: 1
386+
borderWidth: 1,
387+
borderColor: '#626c91' // 显式声明边框色(原隐含于normal)
388+
},
389+
emphasis: {
390+
// 全局emphasis提升到顶层
391+
itemStyle: {
392+
color: '#626c91'
393+
}
383394
},
384395
controlStyle: {
385396
color: '#626c91',
386397
borderColor: '#626c91',
387-
borderWidth: 0.5
388-
},
389-
emphasis: {
390-
controlStyle: {
398+
borderWidth: 0.5,
399+
// v6中controlStyle的emphasis需单独声明
400+
emphasis: {
391401
color: '#626c91',
392402
borderColor: '#626c91',
393403
borderWidth: 0.5
@@ -398,10 +408,8 @@ export const chartThemeUtil = (
398408
borderColor: 'rgba(63,177,227,0.15)'
399409
},
400410
label: {
401-
color: '#626c91'
402-
},
403-
emphasis: {
404-
label: {
411+
color: '#626c91', // 直接文本颜色声明
412+
emphasis: {
405413
color: '#626c91'
406414
}
407415
}

0 commit comments

Comments
 (0)