In an application where I plot multiple lines in a QCustomPlot, I need to add newData to the plot dynamically, something like this:
//QVector<double> newData; at somewhere else QCPGraph *graph = ui->customPlot->addGraph(); graph->setData(x, newData); ui->customPlot->replot();
Is there an easy way to prevent creating new graph for newData if it has been added to a graph before? In QChart, addSeries will reject QSplineSeries etc if it has been added before, I wonder if QCustomPlot can do something similar? Thanks.