Adding a line series to the chart view

We agreed that a reasonable visualization for the near-sinusoidal data produced by the mock sensor and transmitted via the broadcaster is a line series, where subsequent data points are linearly interpolated. You can choose an alternative visualization if you prefer. The LineSeries QML type (https://doc.qt.io/qt-5.9/qml-qtcharts-lineseries.html) should be contained in a ChartView type (https://doc.qt.io/qt-5.9/qml-qtcharts-chartview.html):

// ReadingsChart.qmlimport QtQuick 2.9import QtCharts 2.2ChartView {    id: chartView    LineSeries {
        id: lineSeries    }}

By previewing the QML document with qmlscene, you'll get an empty X/Y chart with a default grid and legend color:

What should we display on the X and ...

Get End to End GUI Development with Qt5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.