|
@@ -33,17 +33,22 @@ function showChart() {
|
|
var passdata = [];
|
|
var passdata = [];
|
|
var faildata = [];
|
|
var faildata = [];
|
|
var passmax = 0;
|
|
var passmax = 0;
|
|
|
|
+ var failratemax=0;
|
|
|
|
|
|
for (i = 0; i < passNumber.length; i++) {
|
|
for (i = 0; i < passNumber.length; i++) {
|
|
if (stackmax < stackeverynum[i]) {
|
|
if (stackmax < stackeverynum[i]) {
|
|
stackmax = stackeverynum[i];
|
|
stackmax = stackeverynum[i];
|
|
}
|
|
}
|
|
- if (failmax < failrate[i]) {
|
|
|
|
- failmax = failrate[i];
|
|
|
|
|
|
+ if (failmax < failNumber[i]) {
|
|
|
|
+ failmax = failNumber[i];
|
|
|
|
+ }
|
|
|
|
+ if (failratemax< failrate[i]) {
|
|
|
|
+ failratemax = failrate[i];
|
|
}
|
|
}
|
|
if (passmax < passNumber[i]) {
|
|
if (passmax < passNumber[i]) {
|
|
passmax = passNumber[i];
|
|
passmax = passNumber[i];
|
|
}
|
|
}
|
|
|
|
+
|
|
data.push(stackeverynum[i]);
|
|
data.push(stackeverynum[i]);
|
|
ratedata.push(Math.floor(failrate[i]));
|
|
ratedata.push(Math.floor(failrate[i]));
|
|
passdata.push(passNumber[i]);
|
|
passdata.push(passNumber[i]);
|
|
@@ -54,9 +59,10 @@ function showChart() {
|
|
showEachSpot1();
|
|
showEachSpot1();
|
|
showEachSpot2();
|
|
showEachSpot2();
|
|
|
|
|
|
-
|
|
|
|
|
|
+ failratemax = Math.max(failratemax, 5);
|
|
stackmax = Math.max(stackmax, 5);
|
|
stackmax = Math.max(stackmax, 5);
|
|
failmax = Math.max(failmax, 5);
|
|
failmax = Math.max(failmax, 5);
|
|
|
|
+ passmax = Math.max(passmax,failmax,stackmax);
|
|
|
|
|
|
stackAndFailChart = Highcharts.chart('graph-1', {
|
|
stackAndFailChart = Highcharts.chart('graph-1', {
|
|
chart: {
|
|
chart: {
|
|
@@ -71,16 +77,16 @@ function showChart() {
|
|
labels: {
|
|
labels: {
|
|
format: '{value}',
|
|
format: '{value}',
|
|
style: {
|
|
style: {
|
|
- color: Highcharts.getOptions().colors[0],
|
|
|
|
|
|
+ color: "#ffffff",
|
|
fontSize: '1.5em'
|
|
fontSize: '1.5em'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
min: 0,
|
|
min: 0,
|
|
max: passmax * 1.5,
|
|
max: passmax * 1.5,
|
|
title: {
|
|
title: {
|
|
-
|
|
|
|
|
|
+ text: '数量',
|
|
style: {
|
|
style: {
|
|
- color: Highcharts.getOptions().colors[0],
|
|
|
|
|
|
+ color: '#ffffff',
|
|
fontSize: '1em'
|
|
fontSize: '1em'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -131,18 +137,18 @@ function showChart() {
|
|
title: {
|
|
title: {
|
|
text: '不良率',
|
|
text: '不良率',
|
|
style: {
|
|
style: {
|
|
- color: 'red',
|
|
|
|
|
|
+ color: '#ffffff',
|
|
fontSize: '1em'
|
|
fontSize: '1em'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
min: 0,
|
|
min: 0,
|
|
- max: 1.5 * failmax,
|
|
|
|
|
|
+ max: 1.5 * failratemax,
|
|
labels: {
|
|
labels: {
|
|
formatter: function () {
|
|
formatter: function () {
|
|
return Math.floor(this.value) + "%";
|
|
return Math.floor(this.value) + "%";
|
|
},
|
|
},
|
|
style: {
|
|
style: {
|
|
- color: 'red',
|
|
|
|
|
|
+ color: '#ffffff',
|
|
fontSize: '20px'
|
|
fontSize: '20px'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -181,12 +187,16 @@ function updateChart() {
|
|
var passdata = [];
|
|
var passdata = [];
|
|
var faildata = [];
|
|
var faildata = [];
|
|
var passmax = 0;
|
|
var passmax = 0;
|
|
|
|
+ var failratemax=0;
|
|
for (i = 0; i < passNumber.length; i++) {
|
|
for (i = 0; i < passNumber.length; i++) {
|
|
if (stackmax < stackeverynum[i]) {
|
|
if (stackmax < stackeverynum[i]) {
|
|
stackmax = stackeverynum[i];
|
|
stackmax = stackeverynum[i];
|
|
}
|
|
}
|
|
- if (failmax < failrate[i]) {
|
|
|
|
- failmax = failrate[i];
|
|
|
|
|
|
+ if (failmax < failNumber[i]) {
|
|
|
|
+ failmax = failNumber[i];
|
|
|
|
+ }
|
|
|
|
+ if (failratemax < failrate[i]) {
|
|
|
|
+ failratemax= failrate[i];
|
|
}
|
|
}
|
|
if (passmax < passNumber[i]) {
|
|
if (passmax < passNumber[i]) {
|
|
passmax = passNumber[i];
|
|
passmax = passNumber[i];
|
|
@@ -196,9 +206,11 @@ function updateChart() {
|
|
passdata.push(passNumber[i]);
|
|
passdata.push(passNumber[i]);
|
|
faildata.push(failNumber[i])
|
|
faildata.push(failNumber[i])
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ failratemax = Math.max(failratemax, 5);
|
|
stackmax = Math.max(stackmax, 5);
|
|
stackmax = Math.max(stackmax, 5);
|
|
failmax = Math.max(failmax, 5);
|
|
failmax = Math.max(failmax, 5);
|
|
|
|
+ passmax = Math.max(passmax,failmax,stackmax);
|
|
|
|
+
|
|
|
|
|
|
// https://api.hcharts.cn/highcharts#Series.addPoint;
|
|
// https://api.hcharts.cn/highcharts#Series.addPoint;
|
|
|
|
|
|
@@ -207,8 +219,8 @@ function updateChart() {
|
|
stackAndFailChart.series[2].setData(data);
|
|
stackAndFailChart.series[2].setData(data);
|
|
FailChart.series[0].setData(ratedata);
|
|
FailChart.series[0].setData(ratedata);
|
|
|
|
|
|
- if (failmax > FailChart.yAxis[0].getExtremes().max * 1.3 || failmax < FailChart.yAxis[0].getExtremes().max * 0.5) {
|
|
|
|
- FailChart.yAxis[0].setExtremes(0, failmax * 1.5);
|
|
|
|
|
|
+ if (failratemax > FailChart.yAxis[0].getExtremes().max * 1.3 || failratemax < FailChart.yAxis[0].getExtremes().max * 0.5) {
|
|
|
|
+ FailChart.yAxis[0].setExtremes(0, failratemax * 1.5);
|
|
}
|
|
}
|
|
if (passmax > stackAndFailChart.yAxis[0].getExtremes().max * 1.3 || passmax < stackAndFailChart.yAxis[0].getExtremes().max * 0.5) {
|
|
if (passmax > stackAndFailChart.yAxis[0].getExtremes().max * 1.3 || passmax < stackAndFailChart.yAxis[0].getExtremes().max * 0.5) {
|
|
stackAndFailChart.yAxis[0].setExtremes(0, passmax * 1.5);
|
|
stackAndFailChart.yAxis[0].setExtremes(0, passmax * 1.5);
|