|
@@ -86,7 +86,7 @@
|
|
|
<view class="chart-content">
|
|
<view class="chart-content">
|
|
|
<view class="chart-canvas-container" v-if="!show" :key="chartKey">
|
|
<view class="chart-canvas-container" v-if="!show" :key="chartKey">
|
|
|
<!-- <div id="tempChart" class="chart-canvas"></div> -->
|
|
<!-- <div id="tempChart" class="chart-canvas"></div> -->
|
|
|
- <qiun-data-charts type="line" :chartData="chartData" :canvas2d="true" :inScrollView="true" />
|
|
|
|
|
|
|
+ <qiun-data-charts type="line" :chartData="chartData" :canvas2d="true" :inScrollView="true" :opts="opts" :ontouch="true"/>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -306,6 +306,37 @@ export default {
|
|
|
{ name: '湿度', id: 'new_hum' },
|
|
{ name: '湿度', id: 'new_hum' },
|
|
|
{ name: '加热仓温度', id: 'others' },
|
|
{ name: '加热仓温度', id: 'others' },
|
|
|
],
|
|
],
|
|
|
|
|
+ opts: {
|
|
|
|
|
+ type: 'line',
|
|
|
|
|
+ xAxis: {
|
|
|
|
|
+ disableGrid: true,
|
|
|
|
|
+ itemCount: 3,
|
|
|
|
|
+ scrollShow: true
|
|
|
|
|
+ },
|
|
|
|
|
+ yAxis: {
|
|
|
|
|
+ disableGrid: true,
|
|
|
|
|
+ gridType: 'dash',
|
|
|
|
|
+ splitNumber: 5,
|
|
|
|
|
+ min: 0,
|
|
|
|
|
+ format: (val) => {
|
|
|
|
|
+ return Math.round(val)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ extra: {
|
|
|
|
|
+ line: {
|
|
|
|
|
+ type: 'curve'
|
|
|
|
|
+ },
|
|
|
|
|
+ tooltip: {
|
|
|
|
|
+ format: {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ value: (val) => Math.round(val)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ legend: {
|
|
|
|
|
+ },
|
|
|
|
|
+ enableScroll: true
|
|
|
|
|
+ },
|
|
|
xData:[],
|
|
xData:[],
|
|
|
yData:[],
|
|
yData:[],
|
|
|
activeChartTab: 0,
|
|
activeChartTab: 0,
|
|
@@ -326,7 +357,9 @@ export default {
|
|
|
handler(newVal, oldVal){
|
|
handler(newVal, oldVal){
|
|
|
this.xData = newVal.map(item => this.formatDate(new Date(item.addtime)));
|
|
this.xData = newVal.map(item => this.formatDate(new Date(item.addtime)));
|
|
|
this.yData = newVal.map(item => Number(item.new_tem) || 0);
|
|
this.yData = newVal.map(item => Number(item.new_tem) || 0);
|
|
|
- this.initChart();
|
|
|
|
|
|
|
+ if(this.xData.length){
|
|
|
|
|
+ this.initChart();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
deep:true,
|
|
deep:true,
|
|
|
immediate:true,
|
|
immediate:true,
|