vue echarts仪表盘渐变色
效果如图
// this.$echarts 为 echarts对象,该代码是使用在vue中的 let option4 = { series: [ { type: 'gauge', center: ['40%', '60%'], startAngle: 200, endAngle: -20, min: 0, max: 60, splitNumber: 7, itemStyle: { color: new this.$echarts.graphic.LinearGradient(0,0,1,0,[ { offset: 0.1, color: "#FFC600" }, { offset: 0.6, color: "#30D27C" }, { offset: 1, color: "#0B95FF" } ]), }, progress: { show: true, width: 5 }, pointer: { show: false }, axisLine: { lineStyle: { width: 30, color:'#FFAB91' } }, axisTick: { distance: -45, splitNumber: 9, lineStyle: { width: 1, color: new this.$echarts.graphic.LinearGradient(0,0,1,0,[ { offset: 0.1, color: "#FFC600" }, { offset: 0.6, color: "#30D27C" }, { offset: 1, color: "#0B95FF" } ]), } }, splitLine: { distance: -52, length: 11, lineStyle: { width: 2, color: new this.$echarts.graphic.LinearGradient(0,0,1,0,[ { offset: 0.1, color: "#FFC600" }, { offset: 0.6, color: "#30D27C" }, { offset: 1, color: "#0B95FF" } ]), } }, axisLabel: { distance: -20, color: new this.$echarts.graphic.LinearGradient(0,0,1,0,[ { offset: 0.1, color: "#FFC600" }, { offset: 0.6, color: "#30D27C" }, { offset: 1, color: "#0B95FF" } ]), fontSize: 0 }, anchor: { show: false }, title: { show: true }, // 图中的34%是我另外添加的,把下面的show设置为true可以显示自带的数字 detail: { valueAnimation: true, width: '60%', lineHeight: 40, borderRadius: 8, offsetCenter: [0, '-15%'], fontSize: 10, fontWeight: 'bolder', formatter: '{value}', color: '#FFAB91', show:false }, data: [ { value: 100 } ] } ] };
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!