Hi, I have a requirement of selecting one point in polar plot. Above all, I have done all the steps referred to the example of polar plot. In order to make point in polar plot selectable, I Called
customPlot->setInteractions(QCP::iSelectPlottables);Then connect signal and slot like this
QCPPolarGraph* pgraph = new QCPPolarGraph(polarAxisAngular, polarAxisAngular->radialAxis());
connect(pgraph,
static_cast<void(QCPPolarGraph::*)(const QCPDataSelection&)>(&QCPPolarGraph::selectionChanged),
[pgraph](const QCPDataSelection& selection){
QSharedPointer<QCPGraphDataContainer> pGraphData = pgraph->data();
QCPDataRange range = selection.dataRange();
});When I test clicking point in QCPPolarGraph, I found that if I only add one data in 270°~360°, it can be selected and trigger slot with a nonempty selection. If I add one point additionally in the same pgraph, the previous point trigger slot with an empty selection when clicked. This only occurred when the previous point appears in 270°~360°.
Maybe my usage of polar plot is so inelegant, I came up with this idea just because I cannot threat QCPPolarGraph as QCPGraph, signal QCustomPlot::plottableClick not emitted. If there is any solution of what I encountered :) Thanks a lot.
Best regards.
Peggle