import * as echarts from "echarts"; export const getRadarOption = () => { return { legend: { data: ["企业平均值", "当前车辆"], bottom: "5%", textStyle: { color: "#FFFEFE", }, }, radar: [ { indicator: [ { text: "路线规律度", max: 100 }, { text: "空置时间比", max: 100 }, { text: "停车集中度", max: 100 }, { text: "驾驶规范度", max: 100 }, { text: "导航使用率", max: 100 }, ], center: ["50%", "45%"], radius: 110, startAngle: 90, splitNumber: 4, shape: "circle", axisName: { formatter: "{value}", textStyle: { color: "#aaa", }, }, splitArea: { areaStyle: { color: [ "rgba(0, 0, 0, 0.1)", "rgba(0, 0, 0, 0.2)", "rgba(0, 0, 0, 0.3)", "rgba(0, 0, 0, 0.4)", "rgba(0, 0, 0, 0.5)", ], shadowColor: "rgba(0, 0, 0, 0.3)", shadowBlur: 10, }, }, axisLine: { lineStyle: { color: "rgba(255, 255, 255, 0.2)", }, }, splitLine: { lineStyle: { color: "rgba(255, 255, 255, 0.2)", }, }, }, ], series: [ { name: "雷达图", type: "radar", emphasis: { lineStyle: { width: 4, }, }, data: [ { value: [80, 88, 72.5, 80, 78], name: "企业平均值", itemStyle: { color: "rgba(170, 216, 39)", }, areaStyle: { opacity: 0.9, color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [ { color: "rgba(170, 216, 39, 0.5)", offset: 0, }, { color: "rgba(170, 216, 39, 0.2)", offset: 1, }, ]), }, }, { value: [85, 82, 80, 65, 98], name: "当前车辆", itemStyle: { color: "rgba(250, 166, 3)", }, areaStyle: { opacity: 0.9, color: new echarts.graphic.RadialGradient(0.5, 0.5, 1, [ { color: "rgba(250, 166, 3, 0.5)", offset: 0, }, { color: "rgba(250, 166, 3, 0.2)", offset: 1, }, ]), }, label: { show: true, color: "rgba(250, 166, 3)", textBorderColor: "#fff", textBorderWidth: 3, position: [0, 0], formatter: (v: any) => { return Math.round(v.value); }, }, }, ], }, ], }; };