QCustomPlot Discussion and Comments

How to select Point on GraphReturn to overview

Hello all,
I'm having trouble selecting data points on my graph
I have selected QCPScatterStyle::ssCircle style for my graph, but cannot click on each point to get highlight.
When I use setSelectable(QCP::stDataRange), there are selected the path lines only, not points
My code:

    connect(ui->wgGraph, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(mousePress()));

void SVP::mousePress()

Thanks all

No one have any ideas ,hub?


First of all you should describe more precisely the code you show, we have no idea what ui->wgGraph is. I supposed that it was your qcustomplot but that's an assumption.

I'm pretty sure you're not doing what you think you're doing. When you setInteractions for your plot it's as if you were telling your plot "be in a mode where i can click data points" (or can click something else depending on the interaction). So just connecting it to the mousePress event is pretty weird and probably something you don't want to do.

You can probably find the solution to your problem and even more by reading this documentation page https://www.qcustomplot.com/documentation/dataselection.html

Thanks you for your supporting.
ui->wgGraph is my qcustomplot.

I want to: highlight the data points when I drag and drop a rectangle onto the graph
You can imagine like the picture below:

And here is code for set graph:

graphSVP = ui->wgGraph->addGraph();
    graphSVP->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssCircle, QPen(Qt::black, 1.5), QBrush(Qt::white), 9));
    graphSVP->setPen(QPen(QColor(120, 120, 120), 2));