‘平均和最小产能改’

This commit is contained in:
2022-08-04 13:52:39 +08:00
parent 50754b55d4
commit 21ac9cdb2c

View File

@@ -464,12 +464,12 @@ export default {
} }
var dataLine = this.data06_d1.sort(paixu) var dataLine = this.data06_d1.sort(paixu)
let numMax = Math.max.apply(null, dataLine) let numMax = Math.max.apply(null, dataLine)
let manNum = numMax + 1 let manNum = numMax * 1.2
let positionLeft = 0.4 let positionLeft = 0.4
let max = manNum + 2 * positionLeft let max = manNum + 2 * positionLeft
let data100 = [] let data100 = []
for (var i = 0; i < dataLine.length; i++) { for (var i = 0; i < dataLine.length; i++) {
data100.push(100) data100.push(manNum)
} }
// var dataLine = [5, 66, 33, 25, 10] // var dataLine = [5, 66, 33, 25, 10]
// let positionLeft = 0.4 // let positionLeft = 0.4
@@ -477,14 +477,14 @@ export default {
var option = { var option = {
grid: [ grid: [
{ {
left: '8%', left: '2%',
top: '5%', top: '5%',
right: '5%', right: '5%',
bottom: '0%', bottom: '0%',
containLabel: true containLabel: true
}, },
{ {
left: '10%', left: '2%',
top: '5%', top: '5%',
right: '5%', right: '5%',
bottom: '0%', bottom: '0%',
@@ -499,7 +499,7 @@ export default {
{ {
axisTick: 'none', axisTick: 'none',
axisLine: 'none', axisLine: 'none',
offset: '5', offset: '2',
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: '#8FABBF', // y轴字体颜色 color: '#8FABBF', // y轴字体颜色
@@ -518,8 +518,7 @@ export default {
color: '#ffffff', color: '#ffffff',
fontSize: '12' fontSize: '12'
} }
}, }
data: [1, 1, 1, 1]
}, },
{ {
axisLine: { axisLine: {
@@ -567,7 +566,7 @@ export default {
}, },
textStyle: { textStyle: {
color: '#ffffff', color: '#ffffff',
fontSize: '16' fontSize: '12'
} }
} }
}, },
@@ -615,8 +614,9 @@ export default {
normal: { normal: {
show: true, show: true,
position: 'right', position: 'right',
distance: 2, distance: 0,
color: '#ffffff', color: '#ffffff',
align: 'right',
formatter: function (data) { formatter: function (data) {
return dataLine[data.dataIndex] + '次' return dataLine[data.dataIndex] + '次'
} }
@@ -714,7 +714,7 @@ export default {
itemGap: 30.86, itemGap: 30.86,
itemWidth: 14.16, itemWidth: 14.16,
itemHeight: 7.38, itemHeight: 7.38,
data: [{name: '最大产能', itemStyle: {color: '#0E90FD'}}, {name: '平均产能', itemStyle: {color: '#33CCCC'}}, {name: '最小产能', itemStyle: {color: '#EAAD24'}}] data: [{name: '最大产能', itemStyle: {color: '#0E90FD'}}, {name: '最小产能', itemStyle: {color: '#33CCCC'}}, {name: '平均产能', itemStyle: {color: '#EAAD24'}}]
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
@@ -790,7 +790,7 @@ export default {
{ {
type: 'line', // 形状为折线图 type: 'line', // 形状为折线图
data: this.taskDate2, data: this.taskDate2,
name: '最小产能', // legend属性 name: '平均产能', // legend属性
barGap: '150%', // 柱图间距 barGap: '150%', // 柱图间距
barWidth: '8', // 柱图宽度 barWidth: '8', // 柱图宽度
itemStyle: { itemStyle: {
@@ -814,7 +814,7 @@ export default {
{ {
type: 'bar', // 形状为柱状图 type: 'bar', // 形状为柱状图
data: this.taskDate, data: this.taskDate,
name: '平均产能', // legend属性 name: '最小产能', // legend属性
barGap: '150%', // 柱图间距 barGap: '150%', // 柱图间距
barWidth: '8', // 柱图宽度 barWidth: '8', // 柱图宽度
itemStyle: { itemStyle: {
@@ -1557,8 +1557,8 @@ export default {
res.result.map((e, i) => { res.result.map((e, i) => {
this.xData.push(e.workprocedure_name) this.xData.push(e.workprocedure_name)
this.yData.push(e.max_productivity) this.yData.push(e.max_productivity)
this.taskDate.push(e.ave_productivity) this.taskDate.push(e.min_productivity)
this.taskDate2.push(e.min_productivity) this.taskDate2.push(e.ave_productivity)
}) })
if (res.result.length) { if (res.result.length) {
clearInterval(this.timeOut1) clearInterval(this.timeOut1)