|
@@ -185,19 +185,62 @@ export default {
|
|
|
height: 524,
|
|
|
});
|
|
|
let k = [],
|
|
|
- item = [],
|
|
|
- max = list[0][this.soft_planting_list[this.soft_planting_act].proportionType] || 0;
|
|
|
+ item = [],
|
|
|
+ max =
|
|
|
+ list[0][
|
|
|
+ this.soft_planting_list[this.soft_planting_act].proportionType
|
|
|
+ ] || 0;
|
|
|
list.map(v => {
|
|
|
- k.push({ name: v.name , max });
|
|
|
- let val = (
|
|
|
- v[this.soft_planting_list[this.soft_planting_act].proportionType] - 0
|
|
|
- ).toFixed(2) - 0;
|
|
|
+ k.push({ name: v.name, max });
|
|
|
+ let val =
|
|
|
+ (
|
|
|
+ v[this.soft_planting_list[this.soft_planting_act].proportionType] -
|
|
|
+ 0
|
|
|
+ ).toFixed(2) - 0;
|
|
|
item.push(val);
|
|
|
});
|
|
|
- var option = {
|
|
|
+ const buildSeries = function(data) {
|
|
|
+ const helper = data.map((item, index) => {
|
|
|
+ const arr = new Array(data.length);
|
|
|
+ arr.splice(index, 1, item);
|
|
|
+ return arr;
|
|
|
+ });
|
|
|
+
|
|
|
+ return [data, ...helper].map((item, index) => {
|
|
|
+ return {
|
|
|
+ type: "radar",
|
|
|
+ symbol: index === 0 ? "circle" : "none",
|
|
|
+ symbolSize: 6,
|
|
|
+ itemStyle: {
|
|
|
+ color: "rgb(157,200,241)",
|
|
|
+ },
|
|
|
+ lineStyle: {
|
|
|
+ color: index === 0 ? "rgb(157,200,241)" : "transparent",
|
|
|
+ width: 1,
|
|
|
+ opacity: 0.5,
|
|
|
+ },
|
|
|
+ areaStyle: {
|
|
|
+ color: index === 0 ? "rgba(157,200,241,.5)" : "transparent",
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: index === 0 ? false : true,
|
|
|
+ formatter: function() {
|
|
|
+ return (
|
|
|
+ k[index - 1].name +
|
|
|
+ ":" +
|
|
|
+ item[index - 1]
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ z: index === 0 ? 1 : 2,
|
|
|
+ data: [item],
|
|
|
+ };
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ let option = {
|
|
|
+ tooltip: {trigger: "item",},
|
|
|
radar: {
|
|
|
- // shape: 'circle',
|
|
|
- indicator: k,
|
|
|
radius: 130,
|
|
|
shape: "circle",
|
|
|
splitNumber: 5,
|
|
@@ -207,38 +250,17 @@ export default {
|
|
|
axisName: {
|
|
|
color: "#0000ee",
|
|
|
},
|
|
|
+ indicator: k,
|
|
|
},
|
|
|
- tooltip: {
|
|
|
- trigger: "item",
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: "radar",
|
|
|
- lineStyle: {
|
|
|
- width: 1,
|
|
|
- opacity: 0.5,
|
|
|
- },
|
|
|
- areaStyle: {
|
|
|
- color: "rgba(157,200,241,.5)",
|
|
|
- },
|
|
|
- itemStyle: {
|
|
|
- color: "#7cb5ec",
|
|
|
- },
|
|
|
- data: [
|
|
|
- {
|
|
|
- value: item,
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- ],
|
|
|
+ series: buildSeries(item),
|
|
|
};
|
|
|
|
|
|
option && this.softAd_chart.setOption(option);
|
|
|
},
|
|
|
numFor(num) {
|
|
|
if (isNaN(num)) return 0;
|
|
|
- if (num >= 100000000) return ((num / 100000000).toFixed(2) -0)+ "亿";
|
|
|
- if (num >= 10000) return ((num / 10000).toFixed(2) -0) + "万";
|
|
|
+ if (num >= 100000000) return (num / 100000000).toFixed(2) - 0 + "亿";
|
|
|
+ if (num >= 10000) return (num / 10000).toFixed(2) - 0 + "万";
|
|
|
return num;
|
|
|
},
|
|
|
},
|