Skip to main content
Version: 7.1.2

RxJS

RxJS is an useful library for connecting real-time data to data visualizations (as well as other business logic).

Because LightningChart JS series are oriented towards handling appending data operations, it is very easy to connect an RxJS observable to them:

// data: Observable<{ x: number, y: number }>
data.subscribe((newSample) => lineSeries.appendSample(newSample))

// ... or
// data: Observable<{ timestamp: number, measurement: number }>
data.subscribe((newSample) => lineSeries.appendSample({ x: newSample.timestamp, y: newSample.measurement }))

Other topics that are closely related to handling real-time data: