Skip to content

Chart

A fast real-time line chart built on uPlot. Each msg.topic becomes a series. Hover to read values at any point in time.

Property Type Default Description
label string Chart Title
unit string Unit shown in the legend
window number 300 Visible time window, in seconds
maxPoints number 2000 Points kept on the server and in the browser
gaps boolean true in the editor Draw a gap where a reading is missing (see Input). A chart deployed before the option existed has it off
// append a point to the "Temperature" series
msg.topic = 'Temperature';
msg.payload = 24.3;
msg.timestamp = Date.now(); // optional, defaults to arrival time
// clear the chart
msg.payload = [];

A reading is a finite number or a numeric string (0, "12.5"). Anything else (null, "", true, "abc", Infinity) is never a 0. By default it is ignored: no point is drawn and the line joins the last and the next value. With gaps on, it appends a gap to that topic’s series instead and the line breaks there, so the operator sees the data was lost; a series that already ends in a gap takes no second one, so a dead sensor adds a single point. The legend shows — while a series ends in a gap. gaps is on for charts you add in the editor; a chart deployed before the option existed keeps it off until you tick Draw a gap for a missing reading.

The server keeps the history, so the chart is full as soon as a browser opens it. Points are kept in timestamp order (equal timestamps in arrival order), so you can backfill history in any order, one series after the other; when maxPoints is exceeded the oldest timestamps are dropped.