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