计算spc并设置最小值和最大值
This commit is contained in:
@ -85,6 +85,8 @@ export default {
|
|||||||
productName.push(item.productName);
|
productName.push(item.productName);
|
||||||
realValue.push(item.realValue);
|
realValue.push(item.realValue);
|
||||||
}
|
}
|
||||||
|
const dataMin = Math.min.apply(Math, realValue);
|
||||||
|
const dataMax = Math.max.apply(Math, realValue);
|
||||||
this.chart.setOption({
|
this.chart.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
@ -113,9 +115,16 @@ export default {
|
|||||||
yAxis: {
|
yAxis: {
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "",
|
name: "",
|
||||||
min: resData.spc.lowerLimit - 50,
|
min:
|
||||||
// max: 250,
|
(dataMin < resData.spc.lowerLimit
|
||||||
// interval: 50,
|
? dataMin
|
||||||
|
: resData.spc.lowerLimit) - 50,
|
||||||
|
max:
|
||||||
|
(dataMax > resData.spc.upperLimit
|
||||||
|
? dataMax
|
||||||
|
: resData.spc.upperLimit) -
|
||||||
|
0 +
|
||||||
|
50,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
formatter: "{value}",
|
formatter: "{value}",
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user