|
@@ -125,15 +125,22 @@ export default {
|
|
|
chartForm: {
|
|
|
itemListTitile: '',
|
|
|
idList: [],
|
|
|
- decimalPlaces: 0,
|
|
|
+ //趋势类型
|
|
|
trendType: 0,
|
|
|
- range: null,
|
|
|
+ //频率值
|
|
|
frequencyValue: 1,
|
|
|
+ //频率类型
|
|
|
frequencyType: 0,
|
|
|
+ //时间值
|
|
|
timeValue: 60,
|
|
|
+ //时间类型
|
|
|
timeType: 0,
|
|
|
startTime: null,
|
|
|
- endTime: null
|
|
|
+ endTime: null,
|
|
|
+ //小数位数
|
|
|
+ decimalPlaces: 2,
|
|
|
+ //量程
|
|
|
+ range: null,
|
|
|
},
|
|
|
chooseStartTime: null,
|
|
|
chooseEndTime: null,
|
|
@@ -388,18 +395,22 @@ export default {
|
|
|
}
|
|
|
seriesData.push(b)
|
|
|
}
|
|
|
- // let decimalPlaces = this.chartForm.decimalPlaces
|
|
|
+ let decimalPlaces = parseInt(this.chartForm.decimalPlaces)
|
|
|
this.tooltip.formatter = function (params, ticket, callback) {
|
|
|
let b = '<div style="display:inline;">'
|
|
|
for (let a of params) {
|
|
|
b += '<div><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + a.color + ';"></span><span style="color:' + a.color + '">'
|
|
|
- + a.name + ' ' + a.seriesName + ': ' + a.data + '</span></div>'
|
|
|
+ + a.name + ' ' + a.seriesName + ': ' + a.data.substring(0, a.data.indexOf(".") + 1 + decimalPlaces) + '</span></div>'
|
|
|
}
|
|
|
b += '</div>'
|
|
|
return b
|
|
|
}
|
|
|
this.legend.data = legendData
|
|
|
this.xAxis.data = data[0].dataTimeList
|
|
|
+ this.yAxis[0].max = null
|
|
|
+ if (this.chartForm.range) {
|
|
|
+ this.yAxis[0].max = parseInt(this.chartForm.range)
|
|
|
+ }
|
|
|
this.series = seriesData
|
|
|
this.chart.setOption({
|
|
|
backgroundColor: this.backgroundColor,
|
|
@@ -500,7 +511,9 @@ export default {
|
|
|
this.series[i].data = arr.splice(num)
|
|
|
}
|
|
|
//更新统计图
|
|
|
- this.chart.setOption({ xAxis: this.xAxis, series: this.series });
|
|
|
+ if (this.chart) {
|
|
|
+ this.chart.setOption({ xAxis: this.xAxis, series: this.series })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|