Graph

<< Click to Display Table of Contents >>

Navigation:  Object Reference > Palette Objects >

Graph

hmtoggle_plus1New and changed features since May 2016

The graph object is designed to show the value history of one or more variables in a line graph.

For each variable that shall be displayed in the graph it can be configured if logging of a value shall happen for every value change or time based (see Log Trigger).

Each logged data point consists of a time stamp and the value at that time stamp. All entries are saved to the non-volatile memory of the device in a ring buffer so that the value history is still available after shutting down and re-booting the device. Logging is active even if the 2D graph object is not visible on the screen.

 

WARNING:If power is completely removed from the device without properly shutting it down using the ignition, it is possible that the last 1% of data in the ring buffer gets lost! Always power down the device using the ignition and the integrated power management!

To save RAM on the device only the data points that are currently shown on the screen are loaded from the hard drive. This means that one can experience slight delays when changing the currently visible time span or the offset because the data needs to be loaded from disk.

To make sure that the non-volatile memory of the device does not get filled up with graph history data, the number of data points that are logged for all graphs in a project is limited (device dependent: on devices with i.MX6 CPU: 34952533 samples (about 400MB on the non-volatile memory), on devices with i.MX35 CPU: 8947848 (about 100MB on the non-volatile memory) ).

Drawing the graph's value lines can be very CPU heavy. The value lines are a polygon that consists of many points. To improve drawing performance, this polygon will be simplyfied if it consists of too many points (current threshold: ~1000 samples). While this improves the drawing performance it may reduce the accuracy of the drawn polygon but may keep the display still usable if too many samples shall be drawn.

The logged history of each graph can be copied from the device and then be converted to a CSV file that in turn can be processed by a spreadsheet application. See here for instructions.

The complete value history can be reset (deleted) with the JavaScript delete2DGraphHistory function.

Displaying the logged data at run time needs some CPU time. To improve performance of the 2D Graph, the object is not redrawn at each variable change but automatically redraws itself with the latest values in a fixed interval (currently about every second). If there are still performance issues the following measures can improve it:

Reduce the numbers of shown variables in the graph

Reduce the number of samples for each variable in the graph (see Number of Samples to Record )

Scale the X axis so that less data points are visible at once

Consider changing the Log Trigger for each variable to Time Based with an appropriate timer value.

If all of the above is not feasable for you application, think about upgrading to a newer device generation with more CPU power

hmtoggle_plus1Variable References
hmtoggle_plus12D Graph Specific Properties
hmtoggle_plus1Variables To Draw
hmtoggle_plus1Process 2D Graph Data on a PC