| | |
| | | <div class="bar-contents"> |
| | | <div class="bar-total"> |
| | | <div class="bar-item">当日合计生产:{{ chartData.total }}</div> |
| | | <div class="bar-item">正品率:{{ chartData.rate }}</div> |
| | | <div class="bar-item">正品率:{{ chartData.rate }}%</div> |
| | | </div> |
| | | <div class="chart" ref="chart"></div> |
| | | </div> |
| | |
| | | // datay: [120, 200, 150, 180, 170, 150, 130, 180, 140], |
| | | // datay2: [20, 30, 50, 40, 70, 50, 30, 80, 40], |
| | | // }, |
| | | startValue: 0, |
| | | endValue: 5, |
| | | chartTimer: null, |
| | | }; |
| | | }, |
| | | watch: { |
| | | "chartData.datay"(val) { |
| | | this.startValue = 0; |
| | | this.endValue = 5; |
| | | this.pieChart("chart", this.chartData); |
| | | }, |
| | | }, |
| | |
| | | '<span style=width:70px;display:inline-block">' + |
| | | "正品率" + |
| | | "</span> " + |
| | | data.rate; |
| | | data.rate + |
| | | "%"; |
| | | list.push(lastString); |
| | | listItem = list.join("<br>"); |
| | | return '<div class="showBox">' + listItem + "</div>"; |
| | |
| | | type: "inside", |
| | | xAxisIndex: 0, |
| | | show: false, |
| | | startValue: 0, // 从头开始 |
| | | endValue: 5, // 一次性展示几个 |
| | | startValue: that.startValue, // 从头开始 |
| | | endValue: that.endValue, // 一次性展示几个 |
| | | zoomOnMouseWheel: false, |
| | | moveOnMouseWheel: true, |
| | | moveOnMouseMove: true, |
| | | }, |
| | | ], |
| | | legend: { |
| | |
| | | color: "#00FFFF", |
| | | }, |
| | | formatter: function (value) { |
| | | if (value.length > 5) { |
| | | return `${value.slice(0, 4)}...`; |
| | | if (value.length > 4) { |
| | | return `${value.slice(0, 3)}...`; |
| | | } |
| | | return value; |
| | | }, |
| | |
| | | this.chartTimer = setInterval(function () { |
| | | // 每次向左滑动一个,最后一个从头开始。 |
| | | if (option.dataZoom[0].endValue == that.chartData.datay.length) { |
| | | option.dataZoom[0].startValue = 0; |
| | | option.dataZoom[0].endValue = 5; |
| | | option.dataZoom[0].startValue = that.startValue; |
| | | option.dataZoom[0].endValue = that.endValue; |
| | | } else { |
| | | option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1; |
| | | option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1; |