修改bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-01-29 15:39:59
|
||||
* @LastEditTime: 2024-03-25 16:56:54
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
legend: {
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
top: '1%',
|
||||
top: '20',
|
||||
// right: '20px',
|
||||
data: ['产线产量', '产线良品率'],
|
||||
textStyle: {
|
||||
@@ -286,7 +286,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.productChart{
|
||||
/* .productChart{
|
||||
top: -10px;
|
||||
}
|
||||
} */
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-03-13 09:04:11
|
||||
* @LastEditTime: 2024-03-25 16:23:12
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -92,18 +92,20 @@ export default {
|
||||
methods: {
|
||||
initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
|
||||
let rawData = []
|
||||
rawData.push(passRateList,wasteList)
|
||||
// console.log(1)
|
||||
const totalData = [];
|
||||
for (let i = 0; i < rawData[0].length; ++i) {
|
||||
let sum = 0;
|
||||
for (let j = 0; j < rawData.length; ++j) {
|
||||
sum += rawData[j][i];
|
||||
let colors = ['#0fdedb', '#2359ec']
|
||||
if (passRateList && wasteList) {
|
||||
rawData.push(passRateList, wasteList)
|
||||
// console.log(1)
|
||||
const totalData = [];
|
||||
for (let i = 0; i < rawData[0].length; ++i) {
|
||||
let sum = 0;
|
||||
for (let j = 0; j < rawData.length; ++j) {
|
||||
sum += rawData[j][i];
|
||||
}
|
||||
totalData.push(sum);
|
||||
}
|
||||
totalData.push(sum);
|
||||
console.log('total', totalData);
|
||||
}
|
||||
let colors = ['#0fdedb', '#2359ec' ]
|
||||
console.log('total', totalData);
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
const series = [
|
||||
'良品',
|
||||
@@ -123,9 +125,9 @@ export default {
|
||||
formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
|
||||
},
|
||||
color:colors[sid],
|
||||
data: rawData[sid].map((d, did) =>
|
||||
data: rawData.length != 0 ? rawData[sid].map((d, did) =>
|
||||
totalData[did] <= 0 ? 0 : d / totalData[did]
|
||||
)
|
||||
) : []
|
||||
};
|
||||
});
|
||||
// let series = [
|
||||
@@ -172,6 +174,7 @@ export default {
|
||||
legend: {
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
top:'30',
|
||||
icon: 'rect',
|
||||
textStyle: {
|
||||
color: '#ffffff'
|
||||
|
||||
Reference in New Issue
Block a user