Index: sources/gui/qml/components/BaseChart.qml =================================================================== diff -u -raf06f02c35f69afe8c8cf9e45873161075dab3ac -rf9133f0e1044c4ab68291eca66cd88f0a2c8a9b4 --- sources/gui/qml/components/BaseChart.qml (.../BaseChart.qml) (revision af06f02c35f69afe8c8cf9e45873161075dab3ac) +++ sources/gui/qml/components/BaseChart.qml (.../BaseChart.qml) (revision f9133f0e1044c4ab68291eca66cd88f0a2c8a9b4) @@ -89,14 +89,27 @@ _xAxis.min = new Date(_xAxis.min.getTime() + hourMs) _xAxis.max = new Date(_xAxis.max.getTime() + hourMs) - // remove points left of the window - while (_line1.count > 0 && _line1.at(0).x < _xAxis.min.getTime()) { - _line1.remove(0) - _line2.remove(0) - _line3.remove(0) - } +// removeOldPoints() + _line1.removePoints(0, vMin) // remove in batch + _line2.removePoints(0, vMin) // remove in batch + _line3.removePoints(0, vMin) // remove in batch } + // remove points old left of the window that are not shown + function removeOldPoints() { + var minX = _xAxis.min + var i = 0 + + // Find how many points to remove that are less thatn visible x axis min + while (i < _line1.count && _line1.at(i).x < minX) + i++ + + if (i > 0) + _line1.removePoints(0, i) // remove in batch + _line2.removePoints(0, i) // remove in batch + _line3.removePoints(0, i) // remove in batch + } + Timer { id: _timer interval : _root.plotFrequency running : false