Line chart
Visualize time series data in Ubidots in the form of Line charts
Last updated
Visualize time series data in Ubidots in the form of Line charts
Last updated
The Line chart widget has multiple options to display and customize data visualization as required by each individual application. Color, time span, aggregation method, among others, are the options available within this widget.
For a preliminary understanding of the widget, please visit this article, which covers the basics about setting up a Line chart widget.
In this section, only advanced features of the Line chart widget will be covered.
This option is only available for Enterprise users
ECharts is a powerful open-source visualization library designed to create interactive and customizable charts. ECharts provides extensive customization options, allowing you to tailor the appearance and behavior of charts to fit specific requirements. With it, you can add new layers of customization to your widgets that simplify monitoring and better suit your users' needs.
In this case, the Line chart widget sits on top of ECharts library, given users the ability to customize the widget by accessing all features provided by the library through the option "ECharts configuration" found in the APPEARANCE tab:
After clicking the option, a big drawer appears from the left exposing the ECharts options JSON that not only maps all fields available from the UI, but also provides an editing environment where users can take full advantage of the Line and Bar series type.
All fields expose through the UI are mapped bidirectionally. This means that if you make a change from the UI, it will be reflected in the EChart options JSON, and viceversa.
The below examples use the ECharts configuration option to get the results shown. Without this advanced option, getting the same visualization isn't possible by only using the UI available fields.
This examples creates colored areas in the widget that work as boundaries to visually see if the data is within expected ranges. Red means alarm, whereas green and orange means safe and warning values, respectively.
This is the ECharts JSON, based on one variable. You'll need to adjust the "series[0].markArea.data" information so the limits reflect your specific needs and data behavior:
This example showcases a line chart where the color of the line changes dynamically based on the value of the data points.
You can set the color ranges (color and data threshold) by modifying each of the pieces within visualMap element in the following ECharts JSON:
This example showcases a line chart similar to the previous one that allows mapping the Y-axis value to a color, however this one also provides color to the area under the chart:
Below is the configuration for this Line Chart. You can customize the colors and ranges for each of the pieces within the visualMap as needed: