Chart Widget
Learn how to use the chart widget on Device and Global Dashboards.
Last updated
Learn how to use the chart widget on Device and Global Dashboards.
Last updated
The chart widget allows to visualise data using a graphical representation that tells how the fields have evolved within a period of time. It allows you to improve the understanding of large amounts of data.
You will find a quick guide to our chart widget here:
On Basics enter a Title and select the Tint Color, which is the background color or the Highlight Color, which is the color of the Title. You can also Hide the background to make it transparent.
Then on Data, select Add Field to configure the fields on your device that you want to display for device dashboards, or select Add Device to configure the device + field that you want to display for global dashboards.
Once selected Fields or Devices, you can choose if you want to show absolute values coming from your devices or only the changes registered in the period of time setup under Timeframe.
You can as well select to display both Absolute and Change. This might be useful for example, to monitor an electric consumption.
You can as well setup a label, the kind of graph you want to display (line chart, area chart or bar chart), the color, interpolation type and the Y Axis.
When you select the line chart, it allows you to select the line thickness.
The interpolation types determine how data points are connected between measurements in a time series. The method chosen affects the appearance of the graph, particularly in areas where there are no data points, influencing the shape of the curve between known points. Here’s an explanation of each of the interpolation methods available on Datacake:
1. Linear Interpolation
How it works: Linear interpolation draws straight lines between each pair of data points.
Graph appearance: It results in a piecewise linear graph with sharp transitions at each data point.
When to use: This is best when the changes between points are relatively simple and do not require smoothing.
2. Natural Interpolation (Cubic Spline)
How it works: Natural interpolation creates a smooth curve using a piecewise cubic function that minimizes abrupt changes in the curve's slope.
Graph appearance: The curve is smooth and continuous with no sharp angles, and it adjusts naturally through the data points.
When to use: This is suitable when the data has a smooth, continuous trend, and you want a natural-looking curve that fits all points exactly.
3. Basis Interpolation
How it works: Basis interpolation creates a smooth curve, similar to a spline, but it does not pass through all the data points. It’s more like an "average" path through the points.
Graph appearance: The result is a very smooth curve, but the curve may not touch the data points exactly.
When to use: Basis interpolation is ideal when you are more concerned with having a smooth-looking trend than exact accuracy to the data points.
4. Monotone Interpolation (Monotonic Cubic Hermite)
How it works: Monotone interpolation ensures that the curve between points does not oscillate and preserves the original trend of the data, so the curve never overshoots the data points.
Graph appearance: It results in a smooth curve that respects the natural ups and downs of the data without creating peaks or valleys that don’t exist in the original data.
When to use: Best for time series data where it’s important to maintain the original trend without creating artificial extremes. It's ideal for data that should increase or decrease smoothly.
5. Step Interpolation
How it works: Step interpolation creates a series of flat, horizontal steps between each pair of data points. The value stays constant between two points until the next point, where it jumps to the new value.
Graph appearance: The result is a graph with sharp, rectangular steps rather than smooth lines.
When to use: This is commonly used when data changes abruptly or you want to highlight the discrete jumps in value over time (e.g., stock prices or event-triggered data).
When you add more than one measurement to your chart widget, make sure to select a new axis for each one of them. This way you ensure that the values get plotted correctly.
You can define the Axis orientation (left or right), define a unit, hide de Y axis and define the domain. If you want you can hide the X axis as well.
Make sure to define the Date Format on the X axis, since this is not done automatically once defined the Timeframe.
The chart widget comes with a time range presets, similar to the value widget, that can be overridden.
Here a small list of the options you can use on both "From" and "Until":
startOfHour
startOfDay
startOfYesterday
startOfWeek
startOfLastWeek
startOfMonth
startOfLastMonth
startOfYear
startOfLastYear
a minute ago
an hour ago
a day ago
7 days ago
a week ago
a month ago
last year
now
You can as well setup a specific date, however, take into consideration that the widget will have to make the operation using the datapoints generated in the time window set. This can have extremely high calculation costs, which will result in degradation of the performance of your dashboards.
Always setup dates that exist! If the date you setup is in the future, the widget won't be able to find the data and the dashboard will crash.
Resolution: You will find an additional parameter to specify the resolution in which the data is displayed on the widget. This settings specifies the time window size in which the datapoints within the given time range will be fetched from the database.
A high resolution leads to significantly longer loading times, since the data must first be retrieved from the server. We therefore suggest setting up daily trends with a higher resolution, in case needed and only weekly or monthly overviews with lower resolution. This will improve the overall performance of your workspaces.
Remember Datacake has a time-series database that does not store all entries, but optimises the storage by taking chunks of it and relating them to a timestamp. This enables the platform to fetch information very quickly and improve the overall performance of the visualisation.
Timezone: Select between a list of timezones. If no timezone is selected, Datacake will take the timezone based on the browser's timezone, which means that customers around the world will be able to see the values in their own timezone.
In the following video, Simon explaines best practices for setting up time ranges on chart widgets, if you want further information.
You can add reference lines on the charts, to be able to compare, reference or observe the values being stored in the database with a defined value. This will be represented as an horizontal line in the chart.
You can define the color, select if the line should be solid or dashed, setup the value as well as a title (Line Text).