历史温度暂时提交
parent
d94d0f7a82
commit
3583296329
|
|
@ -4,7 +4,7 @@
|
||||||
<view>
|
<view>
|
||||||
<uni-row class="demo-uni-row" >
|
<uni-row class="demo-uni-row" >
|
||||||
<uni-col :span="8">
|
<uni-col :span="8">
|
||||||
<uni-data-select v-model="imei" :localdata="agriList" @change="changeAgri"></uni-data-select>
|
<uni-data-select style="background: #fff" v-model="imei" :localdata="agriList" @change="changeAgri"></uni-data-select>
|
||||||
|
|
||||||
</uni-col>
|
</uni-col>
|
||||||
<uni-col :span="16">
|
<uni-col :span="16">
|
||||||
|
|
@ -24,8 +24,13 @@
|
||||||
:canvas2d="true"
|
:canvas2d="true"
|
||||||
canvasId="nMPkeQGNEosMwoWKKNRBZBIEhguMoMWp"
|
canvasId="nMPkeQGNEosMwoWKKNRBZBIEhguMoMWp"
|
||||||
:ontouch="true"
|
:ontouch="true"
|
||||||
|
:disableScroll="true"
|
||||||
:onmovetip="true"
|
:onmovetip="true"
|
||||||
|
:onzoom="true"
|
||||||
|
tooltipFormat="tooltipDemo"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
<!-- 暂无数据 -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -41,6 +46,12 @@ export default {
|
||||||
chartData: {},
|
chartData: {},
|
||||||
//这里的 opts 是图表类型 type="line" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['line'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
//这里的 opts 是图表类型 type="line" 的全部配置参数,您可以将此配置复制到 config-ucharts.js 文件中下标为 ['line'] 的节点中来覆盖全局默认参数。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
||||||
opts: {
|
opts: {
|
||||||
|
legend: {
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
rotateAngle: 75,
|
||||||
|
format: "xAxisDemo"
|
||||||
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
gridType: "dash",
|
gridType: "dash",
|
||||||
dashLength: 2,
|
dashLength: 2,
|
||||||
|
|
@ -202,6 +213,9 @@ export default {
|
||||||
changeDate(date) {
|
changeDate(date) {
|
||||||
// date[0]-date[1]
|
// date[0]-date[1]
|
||||||
console.info("日期选择器:",date)
|
console.info("日期选择器:",date)
|
||||||
|
if (date[0] === date[1]) {
|
||||||
|
this.dateRange[0] = parseTime(date[0], '{y}-{m}-{d} 00:00:00')
|
||||||
|
}
|
||||||
if (this.imei) {
|
if (this.imei) {
|
||||||
this.getServerData();
|
this.getServerData();
|
||||||
}
|
}
|
||||||
|
|
@ -214,6 +228,6 @@ export default {
|
||||||
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||||
.charts-box {
|
.charts-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 300px;
|
height: 500px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -57,8 +57,21 @@ const cfu = {
|
||||||
"yAxisDemo1":function(val, index, opts){return val+'元'},
|
"yAxisDemo1":function(val, index, opts){return val+'元'},
|
||||||
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)},
|
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)},
|
||||||
"xAxisDemo1":function(val, index, opts){return val+'年';},
|
"xAxisDemo1":function(val, index, opts){return val+'年';},
|
||||||
|
"xAxisDemo":function(val, index, opts){
|
||||||
|
if (!val || typeof val === 'number' || !isNaN(val)) return "";
|
||||||
|
return val.split(" ")[1];
|
||||||
|
},
|
||||||
"xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')},
|
"xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')},
|
||||||
"seriesDemo1":function(val, index, series, opts){return val+'元'},
|
"seriesDemo1":function(val, index, series, opts){return val+'元'},
|
||||||
|
"tooltipDemo":function(item, category, index, opts){
|
||||||
|
if(index!==0) {
|
||||||
|
var unit = "%RH";
|
||||||
|
if (item.name.includes("温度")) {
|
||||||
|
unit = "℃";
|
||||||
|
}
|
||||||
|
return `${item.name}: ${item.data} ${unit}`
|
||||||
|
}
|
||||||
|
},
|
||||||
"tooltipDemo1":function(item, category, index, opts){
|
"tooltipDemo1":function(item, category, index, opts){
|
||||||
if(index==0){
|
if(index==0){
|
||||||
return '随便用'+item.data+'年'
|
return '随便用'+item.data+'年'
|
||||||
|
|
@ -329,14 +342,14 @@ const cfu = {
|
||||||
lineHeight: 20,
|
lineHeight: 20,
|
||||||
fontColor: "#FFFFFF",
|
fontColor: "#FFFFFF",
|
||||||
legendShow: true,
|
legendShow: true,
|
||||||
legendShape: "auto",
|
legendShape: "square",
|
||||||
splitLine: true,
|
|
||||||
horizentalLine: false,
|
horizentalLine: false,
|
||||||
xAxisLabel: false,
|
splitLine: true,
|
||||||
|
xAxisLabel: true,
|
||||||
yAxisLabel: false,
|
yAxisLabel: false,
|
||||||
labelBgColor: "#FFFFFF",
|
labelBgColor: "#FFFFFF",
|
||||||
labelBgOpacity: 0.7,
|
labelBgOpacity: 0.7,
|
||||||
labelFontColor: "#666666"
|
labelFontColor: "#ff0d0d"
|
||||||
},
|
},
|
||||||
markLine: {
|
markLine: {
|
||||||
type: "solid",
|
type: "solid",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue