Smart.StripChart is a real-time chart for continuously acquired samples. The newest sample is drawn at the right and the oldest leaves at the left.

The buffer is a ring buffer: a push writes one slot and moves an index, so the cost of a sample does not grow with the history. Drawing is batched per animation frame, so the chart can accept samples at 10 kHz and still draw sixty times per second.

Four channels at 20 Hz

Keyboard: the legend is a single tab stop. Use the arrow keys to move between pens and Enter or Space to show or hide one.

Scaling

Four signals with very different magnitudes. In perPen mode each pen uses the full height against its own range, so signals of different magnitudes can be compared by shape. In shared mode all pens use one range, so they can be compared by value.

Modes

In scroll mode the trace moves and the newest sample stays at the right edge. In sweep mode the trace stays in place and a write cursor moves across it, like a persistence scope, which makes it easier to watch for a shape than for a trend.

scroll

sweep

Time axis

In time mode the x position comes from the sample timestamp instead of the sample index, so an irregular feed, such as data from a plant historian, is spaced correctly instead of being drawn as if it were evenly sampled. With showScales the chart draws a y scale down the left and, here, seconds before now along the bottom - the two scales a classic waveform chart has.