/* * @Description: * @Autor: chengq * @Date: 2022-07-28 11:40:09 * @LastEditors: 程迁 * @LastEditTime: 2022-07-28 14:15:48 * @Author: 程迁 */ import * as echarts from 'echarts/core'; const styleMap = new Map() styleMap.set(0, { detail: { fontSize: 24 }, pointer: { width: 3, }, color: '#467FEA', colorSet: new echarts.graphic.LinearGradient(0, 0, 1, 0, [ { offset: 0.2, color: '#3dbdd0' }, { offset: 0.3, color: '#63dcac' }, { offset: 0.6, color: '#38b2d4' }, { offset: 0.8, color: '#e48c2b' }, { offset: 1, color: '#e67a70' } ]), axisLineWidth: 8, // 轴线宽度 axisTickDistance: 7, // 轴线与刻度之间的距离 outCircleColor: '#f2f6fd', // 表盘刻度背景圆颜色 insideCircleColor: '#dce7fa', // 表盘内部圆颜色 } ) styleMap.set(1, { detail: { fontSize: 12 // 数字大小 }, pointer: { width: 2, // 指针大小 }, color: '#dec9b4', colorSet: new echarts.graphic.LinearGradient(1, 0, 0, 0, [ { offset: 0.2, color: '#7CF8A2' }, { offset: 0, color: '#dec9b4' } ]), axisLineWidth: 2, axisTickDistance: 3, outCircleColor: '#415374', // 表盘刻度背景圆颜色 insideCircleColor: '#2b426b', // 表盘内部圆颜色 } ) export const getDashboardStyle = (type: number | undefined) => { return styleMap.get(type) }