|
|
@@ -64,7 +64,6 @@ function FaultTotal(props) { |
|
|
|
export default FaultTotal; |
|
|
|
|
|
|
|
function preHandleStatisticData(data, legend) { |
|
|
|
console.table(data); |
|
|
|
const obj = {}; |
|
|
|
data.forEach((item) => { |
|
|
|
obj[item.name] = {}; |
|
|
@@ -86,17 +85,18 @@ function preHandleStatisticData(data, legend) { |
|
|
|
data: [], |
|
|
|
})); |
|
|
|
|
|
|
|
const seriesData = []; |
|
|
|
legend.forEach((item, index) => { |
|
|
|
series[index].name = item; |
|
|
|
data.forEach((d, index) => { |
|
|
|
if (index == 0) { |
|
|
|
series[index].label = { |
|
|
|
show: true, |
|
|
|
position: "top", |
|
|
|
distance: 10, |
|
|
|
color: "#fffc", |
|
|
|
}; |
|
|
|
} |
|
|
|
data.forEach((d, idx) => { |
|
|
|
// if (index == 0) { |
|
|
|
// series[index].label = { |
|
|
|
// show: true, |
|
|
|
// position: "top", |
|
|
|
// distance: 10, |
|
|
|
// color: "#fffc", |
|
|
|
// }; |
|
|
|
// } |
|
|
|
series[index].data.push(obj[d.name][item] || 0); |
|
|
|
}); |
|
|
|
}); |
|
|
|