The Frequency widget allows you to plot data stored in the context of a variable's data points. Imagine an ECG application measuring heart rate at 60 Hz. This would require sending 60 dots per second, which is well-above our API rate limit. Instead, you can store those samples inside the context of a variable, and then use the frequency widget to visualize the data.
Another interesting application is the data analysis in the frequency domain. This representation becomes useful to perceive several attributes of the signal that are not easy to observe in the time series domain. For instance, vibration analysis in industrial rotors is a known way to determine whether maintenance is needed or not. The Frequency Chart widget allows you to analyze such types of phenomena based on the harmonics, magnitude, phase, bandwidth, etc.
Requirements
An active Ubidots account (Industrial license and above).
One or more variables with an array of data points, separated by a comma.
1. Storing your data so it can be understood by the Frequency widget
The Frequency widget will automatically understand data stored in the given context keys, in either one of these formats:
Format | Example |
An array of data, enclosed in double quotes | "context":{"key":"[1,2,3,4,5,6,7]"} |
An array of data, with each item enclosed in double quotes | "context":{"key":["1","2","3","4","5,"6","7"]} |
A double-quoted array of data, with each element enclosed in double quotes.
| "context":{"key":"["1","2","3","4","5","6","7"]"}
|
2. Create a Frequency Chart Widget
Go to the "Data" dropdown in the navigation bar, then "Dashboards", and select the dashboard you'll be working on. Next, follow the steps below to create a Frequency Chart widget:
Step 1: Click on the top-right “+” button in your dashboard.
Step 2: Select the Frequency Chart option.
Step 3: Add the Y-axis variable(s) to be displayed and fill the following parameters:
Change the variable label selected by clicking on the plus icon on the right side of the Variable label field.
Set the Context key where the data is stored.
Select the data Color of your preference in the color picker.
Step 4: Add the X-axis variable and fill the following parameters:
Change the variable label selected by clicking on the plus icon on the right side of the Variable label field.
Set the Context key where the data is stored.
IMPORTANT NOTE: The widget will be plotted based on the amount of data the X-axis has. The Y-Axis variable(s) will fit that data frame.
ADDITIONAL NOTE: if your dashboard and the Frequency Chart widget are dynamic, you can change the variable label by typing in this field.
Step 5: Edit the appearance of the widget by filling the following parameters:
Set the Name of the widget.
Set the X-axis range of the widget.
Type the X-axis label to be displayed in the widget.
Set the Y-axis range of the widget.
Type the Y-axis label to be displayed in the widget.
If any, enter a Custom Style for your widget.
Other users also found helpful...