refactor(chart): 图标颜色优化

This commit is contained in:
郝先瑞
2022-03-05 21:04:50 +08:00
parent e0a85760db
commit 7902783998
4 changed files with 59 additions and 18 deletions

View File

@@ -11,6 +11,7 @@
import {nextTick, onActivated, onBeforeUnmount, onDeactivated, onMounted} from "vue";
import {init, EChartsOption} from 'echarts'
import resize from "@/utils/resize";
import * as echarts from "echarts";
const props = defineProps({
id: {
@@ -54,7 +55,7 @@ function initChart() {
fontSize: 18,
fontStyle: 'normal',
fontWeight: 'bold',
color:'#096b92'
color: '#337ecc'
}
},
grid: {
@@ -74,13 +75,22 @@ function initChart() {
center: ['50%', '50%'],
roseType: 'area',
itemStyle: {
borderRadius: 8
borderRadius: 6,
normal: {
color: function (params: any) {
//自定义颜色
const colorList = [
'#409EFF', '#67C23A', '#E6A23C', '#F56C6C'
];
return colorList[params.dataIndex]
}
}
},
data: [
{ value: 26, name: '家用电器' },
{ value: 27, name: '户外运动' },
{ value: 24, name: '汽车用品' },
{ value: 23, name: '手机数码' }
{value: 26, name: '家用电器'},
{value: 27, name: '户外运动'},
{value: 24, name: '汽车用品'},
{value: 23, name: '手机数码'}
]
}
]