当前位置:网站首页>(super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
(super detailed II) detailed visualization of onenet data, how to plot with intercepted data flow
2022-07-06 13:20:00 【Lunan wind】
Catalog
Dashboard segment ( Get and upload the last set of data )
Preface
In the last article, we used sensors to access onenet platform , Upload the collected data in real time . When we turn on the device , Open the data flow and look at the rows of refreshed data , Is there any more intuitive method ? For example, intercept the data stream for visual processing , Draw a curve with data points , Or use instruments to feel the changes of collected data ?
Hardware construction
https://blog.csdn.net/qq_45998204/article/details/124686714
See the previous chapter
onenet Platform preparation

Create a new panel

Add regular charts in the required format by yourself

Data flow import
Open the data , Manage data sources




In this way, when we open the data source selection , We can find the data stream we uploaded

How to control the dashboard , Open the private filter , Make changes , Look at the value changes

data----- Selected data flow value
rootdata---- All data flow values under the device
OneNET View Filters are provided to personalize data sources , Users can write by themselves JavaScript Code , Realize data structure transformation 、 Screening and some simple calculations

Input data, We can observe that , The dashboard changes with the returned data flow value
Open the data processing result , You can intuitively observe the information returned by the data flow , We set the refresh interval 5 second , Data points 100, In so many data processing results , We need to intercept The latest set of data Application dashboard display
Next is how to intercept the data values we need to plot

Open the private filter , Make changes , Let it return the last set of data
call function last(arr)
take last(data) Assign to value

Open the data processing result , The latest set of data shows the same

Dashboard segment ( Get and upload the last set of data )
// last([1, 2]); // -> 2
function last(arr) {
var len = arr ? arr.length : 0;
if (len) return arr[len - 1];
}
return [{
value: last(data).value,
name: ' temperature '
}]After modifying the program, be sure to save
Observing a single data cannot express the overall situation well
So we introduce the graph
Select the defined graph , After adding data sources , Modify private filter , Return the data stream data( preservation !)

Then open the data processing results , There are many groups of data , We need to select useful data to help draw , such as Upload time , The uploaded Sampling value ( temperature )

Usually, the results returned by the data source are mostly array types , Each element can be processed through iteration .

Open the private filter

Curve code segment
data.forEach((item, index) => {
// console.log(' Elements :', item, '; Subscript :', index);
item.x = item.update_at
item.y = item.value
});
return data 
The same is true for uploading multiple devices and data streams

link
( The personal visualization was later redone for the project , Temporarily close access )
Be careful
After reading the comments, I found that some people did not draw , There is no problem with the process , There is a small detail to pay attention to
When importing general charts, there are three series , After copying the program, only x Axis update , It's because of here y The axis field name is y1, And the program assignment is y, Just modify here

I'll do it again when I'm free rootdata Use
Welcome to exchange
边栏推荐
- 165. Compare version number - string
- TYUT太原理工大学2022数据库大题之数据库操作
- 记录:Navicat Premium初次无法连接数据库MySQL之解决
- Pride-pppar source code analysis
- Application architecture of large live broadcast platform
- TYUT太原理工大学2022“mao gai”必背
- 西安电子科技大学22学年上学期《信号与系统》试题及答案
- MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列
- 系统设计学习(三)Design Amazon‘s sales rank by category feature
- Inheritance and polymorphism (I)
猜你喜欢

View UI Plus 发布 1.3.0 版本,新增 Space、$ImagePreview 组件

TYUT太原理工大学2022数据库大题之分解关系模式

Small exercise of library management system

arduino+DS18B20温度传感器(蜂鸣器报警)+LCD1602显示(IIC驱动)

Problems and solutions of robust estimation in rtklib single point location spp

Tyut Taiyuan University of technology 2022 introduction to software engineering summary

MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series

几道高频的JVM面试题

Fairygui bar subfamily (scroll bar, slider, progress bar)

IPv6 experiment
随机推荐
IPv6 experiment
Abstract classes and interfaces
A brief introduction to the database of tyut Taiyuan University of technology in previous years
String类
TYUT太原理工大学2022软工导论简答题
XV Function definition and call
Small exercise of library management system
TYUT太原理工大学2022数据库大题之E-R图转关系模式
系统设计学习(二)Design a key-value cache to save the results of the most recent web server queries
4.30动态内存分配笔记
六种集合的遍历方式总结(List Set Map Queue Deque Stack)
Quickly generate illustrations
GNSS positioning accuracy index calculation
十分鐘徹底掌握緩存擊穿、緩存穿透、緩存雪崩
Inheritance and polymorphism (I)
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
[while your roommate plays games, let's see a problem]
TYUT太原理工大学2022数据库大题之概念模型设计
Voir ui plus version 1.3.1 pour améliorer l'expérience Typescript