refactor(chart): 图标颜色优化
This commit is contained in:
@@ -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: '手机数码'}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user