QCustomPlot Discussion and Comments

how to add several hundred points and each point can be selectedReturn to overview

I use
QVector<double> x(1), y(1);
ui->customPlot->addGraph();
ui->customPlot->graph()->setData(x,y);
for several hundred times,but it is too slow(take 10 or more seconds).
then what structure should I use.

well I know,I use ui->customPlot->replot(); within the loop,it took notime when I place it outside the loop.

Hi,
I tried what you propose here to be able to select each pair of points, but can't make it work.
First, I loop through the points adding a new graph
each time and setting scatter style. Finally I use QCP::iSelectItems and replot. What am I doing wrong?
Thanks.

for ( int i = 0; i < x.size(); ++i )
{
QVector<double> x1(1);
x1[0] = x;
QVector<double> y1(1);
y1[0] = y;
ui->customPlot->addGraph();
ui->customPlot->graph()->setData(x1, y1);
// display each point as a circle:
ui->customPlot->graph()->setScatterStyle(QCPScatterStyle::ssDisc);
}

ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectItems);