+
{{ n.projectName }}
@@ -448,80 +448,83 @@ export default {
let dataoption = [];
let totalArr = [];
_this.optionDatalist3 = [];
- response = [{ name: "1月", code: "100", value: '100', }]
- if (response.length > 0) {
- response.forEach((item) => {
- let a = {};
- a.name = item.equName;
- a.value = item.monthData;
- a.code = item.equCode;
- _this.optionDatalist3.push(a);
- dataoption.push(a);
- numberlist.push(item.monthData);
- });
- dataoption.sort((a, b) => {
- return a.value - b.value;
- });
- let max = Math.max(...numberlist);
- max = max + 100;
- dataoption.forEach((item) => {
- totalArr.push(max);
- });
- option3 = {
- yAxis: [
- {
- data: dataoption,
- },
- ],
- series: [
- {
- data: dataoption,
- itemStyle: {
- normal: {
- color: function (params) {
- var index_num = params.value;
-
- for (var i = 0; i < dataoption.length; i++) {
- //判断数据是否大于1
- if (index_num > 1131) {
- //var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
- //return colorList[params.dataIndex];
- return new echarts.graphic.LinearGradient(
- 0,
- 0,
- 1,
- 0,
- [
- { offset: 0, color: "#FFB742" },
- { offset: 1, color: "#FFB742" },
- ]
- );
- } else {
- //var colorList = ['blue'];
- //return colorList[params.dataIndex];
- return new echarts.graphic.LinearGradient(
- 0,
- 0,
- 1,
- 0,
- [
- { offset: 0, color: "#005954" },
- { offset: 1, color: "#66E1DF" },
- ]
- );
- }
+ console.log(response)
+ for (let index = 0; index < response.month.length; index++) {
+ let a = {};
+ response.month[index] = moment(response.month[index]).format('MM')
+ a.name = response.month[index] + '月'
+ a.value = response.monthData[index]
+ a.code = response.monthData[index]
+ dataoption.push(a);
+ numberlist.push(response.monthData[index]);
+ }
+ // dataoption.sort((a, b) => {
+ // return a.value - b.value;
+ // });
+ dataoption = dataoption.reverse()
+ let max = Math.max(...numberlist);
+ max = max + 100;
+ dataoption.forEach((item) => {
+ totalArr.push(max);
+ });
+ console.log(dataoption, numberlist)
+ // response = [{ name: "1月", code: "100", value: '100', }]
+ // if (response.length > 0) {
+ option3 = {
+ yAxis: [
+ {
+ data: dataoption,
+ },
+ ],
+ series: [
+ {
+ data: dataoption,
+ itemStyle: {
+ normal: {
+ color: function (params) {
+ var index_num = params.value;
+
+ for (var i = 0; i < dataoption.length; i++) {
+ //判断数据是否大于1
+ if (index_num > 1131) {
+ //var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
+ //return colorList[params.dataIndex];
+ return new echarts.graphic.LinearGradient(
+ 0,
+ 0,
+ 1,
+ 0,
+ [
+ { offset: 0, color: "#FFB742" },
+ { offset: 1, color: "#FFB742" },
+ ]
+ );
+ } else {
+ //var colorList = ['blue'];
+ //return colorList[params.dataIndex];
+ return new echarts.graphic.LinearGradient(
+ 0,
+ 0,
+ 1,
+ 0,
+ [
+ { offset: 0, color: "#005954" },
+ { offset: 1, color: "#66E1DF" },
+ ]
+ );
}
- },
+ }
},
},
},
- {
- data: totalArr,
- },
- ],
- };
- myChart3.setOption(option3);
- }
+ },
+ {
+ data: totalArr,
+ },
+ ],
+ };
+ myChart3.setOption(option3);
+ // }
}
});
var myChart5 = echarts.init(document.querySelector("#echart5"));
@@ -581,7 +584,7 @@ export default {
yAxis: [
{
type: 'value',
- name: '万元',
+ name: '',
nameTextStyle: {
color: '#D0DEEE'
},
@@ -618,33 +621,38 @@ export default {
}).then((response) => {
if (response) {
let seriesmyChart5 = []
+ let legenddata = []
let dataoption = response.series;
let xAxisdata = response.dayStr
let yAxismax = []
let yAxismaxall = 0
dataoption.forEach((n) => {
- if (e.data) {
- console.log(Math.max(e.data), e.data)
- yAxismax.push(Math.max(...e.datax))
+ if (n.data) {
+ console.log(Math.max(...n.data), n.data)
+ yAxismax.push(Math.max(...n.data))
}
var item = {
- name: e.planktonname,
- data: e.data,
+ name: n.machineName,
+ data: n.data,
emphasis: {
focus: 'series'
},
type: "bar",
- stack: e.planktonname,
+ stack: n.machineName,
}
+ legenddata.push(n.machineName)
seriesmyChart5.push(item);
});
yAxismaxall = Math.max(...yAxismax) + 5
- myChart5 = {
+ option5 = {
xAxis: [
{
data: xAxisdata,
},
],
+ legend:{
+ data:legenddata
+ },
yAxis: [
{
max: yAxismaxall
@@ -652,6 +660,7 @@ export default {
],
series: seriesmyChart5
};
+ console.log(seriesmyChart5,'111111111111111')
myChart5.setOption(option5);
}
});
@@ -666,8 +675,13 @@ export default {
containLabel: true
},
tooltip: {
- show: true,
- trigger: 'item'
+ trigger: 'axis',
+ axisPointer: {
+ type: 'cross',
+ crossStyle: {
+ color: '#999'
+ }
+ }
},
legend: {
show: true,
@@ -779,9 +793,28 @@ export default {
yAxisIndex: 1,
itemStyle: {
normal: {
- color: '#00d4c7',
+ color: '#5260CE',
lineStyle: {
- color: "#00d4c7",
+ color: "#5260CE",
+ width: 1
+ },
+
+ }
+ },
+ data: []
+ },
+ {
+ name: '不合格比例',
+ type: 'line',
+ stack: '总量',
+ symbol: 'circle',
+ symbolSize: 8,
+ yAxisIndex: 1,
+ itemStyle: {
+ normal: {
+ color: '#88E4E3',
+ lineStyle: {
+ color: "#88E4E3",
width: 1
},
@@ -809,6 +842,27 @@ export default {
)
}
},
+ },
+ {
+ name: '不合格数量',
+ data: [],
+ type: 'bar',
+ showBackground: true,
+ backgroundStyle: {
+ color: 'rgba(180, 180, 180, 0.2)'
+ },
+ itemStyle: {
+ normal: {
+ barBorderRadius: 5,
+ color: new echarts.graphic.LinearGradient(
+ 0, 0, 0, 1,
+ [
+ { offset: 0, color: "#66E1DF" },
+ { offset: 1, color: "#005954" },
+ ]
+ )
+ }
+ },
}
]
@@ -819,10 +873,27 @@ export default {
factoryCode: 'ds_' + _this.selectxt,
}).then((response) => {
if (response) {
- let seriesdata1 = response[0].data
- let seriesdata2 = response[0].dataStr
+ let seriesdata1 = response[0].dataBarArrays
+ let seriesdata2 = response[0].dataLineArrays
let xAxisdata = response[0].dayStr
- let yAxismax = Math.max(...seriesdata1) + 5
+ let seriesdata3 = response[1].dataBarArrays
+ let seriesdata4 = response[1].dataLineArrays
+ let max1 = Math.max(...seriesdata1) + 5
+ let max2 = Math.max(...seriesdata3) + 5
+ let max3 = Math.max(...seriesdata2) + 5
+ let max4 = Math.max(...seriesdata4) + 5
+ let yAxismax1 = 0
+ let yAxismax2 = 0
+ if (max1 > max2) {
+ yAxismax1 = max1
+ } else {
+ yAxismax1 = max2
+ }
+ if (max3 > max4) {
+ yAxismax2 = max3
+ } else {
+ yAxismax2 = max4
+ }
option6 = {
xAxis: [
{
@@ -831,15 +902,24 @@ export default {
],
yAxis: [
{
- max: yAxismax
+ max: yAxismax1
+ },
+ {
+ max: yAxismax2
}
],
series: [
{
data: seriesdata2,
},
+ {
+ data: seriesdata4,
+ },
{
data: seriesdata1,
+ },
+ {
+ data: seriesdata3,
}
]
};
@@ -853,14 +933,14 @@ export default {
let intactRate = 0
let numberAngle = 360
let intactRate1 = 0
- let numberAngle2 = 360
+ let numberAngle1 = 360
if (_this.equipmentinfo.todayOkRate) {
- intactRate = _this.equipmentinfo.todayOkRate
- numberAngle = (100 - parseInt(_this.equipmentinfo.intactRate)) * 3.6
+ intactRate = parseFloat(_this.equipmentinfo.todayOkRate)
+ numberAngle = (100 - parseInt(_this.equipmentinfo.todayOkRate)) * 3.6
}
if (_this.equipmentinfo.monthOkRate) {
- intactRate1 = _this.equipmentinfo.monthOkRate
- numberAngle2 = (100 - parseInt(_this.equipmentinfo.monthOkRate)) * 3.6
+ intactRate1 = parseFloat(_this.equipmentinfo.monthOkRate)
+ numberAngle1 = (100 - parseInt(_this.equipmentinfo.monthOkRate)) * 3.6
}
var myChart1 = echarts.init(document.querySelector("#echart1"));
var option1 = {
@@ -1159,7 +1239,7 @@ export default {
//起始角度。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。
startAngle: 360,
//结束角度。
- endAngle: numberAngle,
+ endAngle: numberAngle1,
center: ["50%", "50%"],
//仪表盘轴线相关配置。
name: "内层盘",
@@ -1285,7 +1365,7 @@ export default {
},
data: [
{
- value: intactRate,
+ value: intactRate1,
},
],
@@ -1740,6 +1820,7 @@ export default {
},
};
+