不要用逐个点添加的方法
void QXYSeries::replace(int index, qreal newX, qreal newY)
改用QList或QVector
void QXYSeries::replace(QList<QPointF> points)
Note: This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() when the points have been replaced. However, note that using the overload that takes QVector as parameter is faster than using this overload.
void QXYSeries::replace(QVector<QPointF> points)
Note: This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits QXYSeries::pointsReplaced() when the points have been replaced.
实测速度快了不少