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