Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How could I optimize a scrolling (not scrollable) QtQuick Chart?



  • I need to optimize a line graph to which data is constantly being appended, with the expectation that old data is discarded and the graph as a whole 'shifts' onward in a constant feed. Dozens of new points are added per second.

    I currently accomplish this by updating the min and max properties of the x Axis within the onPointAdded function. However, this slows down my application as it redraws the entire graph.

    Is there some way to optimize this, for example such that the chart properly shifts the previously drawn image to the side in-GPU and draws only new points? Or, if that is not possible, is there some way to take advantage of Qt Chart drawing code while using custom rendering logic to achieve this optimization manually with OpenGL?



  • @tague Are you currently updating every time a point is added? If so, I wondered if you could buffer the incoming data so that you do not update so frequently? Perhaps use a QTimer to control update frequency.