QCustomPlot User Manual (3) and qcustomplot User Manual
I. Scope of change
QCustomPlot *customplot;customplot->setInteraction(QCP::iRangeDrag,true);
Allows controls to be dragged.
customplot->axisRect()->setRangeDrag(Qt::Vertical);// Qt::Horizontal
The control can only be dragged up on one side. It is supported by both water and vertical by default.
customplot->setInteraction(QCP::iRangeZoom,true);
Allows the control to be scaled.
customplot->axisRect()->setRangeZoomAxes(QCPAxis * horizontal, QCPAxis * vertical);
Set the coordinate axis for scaling.
customplot->axisRect()->setRangeZoom();
Set the scaling direction. Both horizontal and vertical are supported by default.
customplot->axisRect()->setRangeZoomFactor();
You can set the scaling ratio to the same value, or set the horizontal and vertical values respectively.
Ii. Select Elements
customplot->setInteraction(QCP::iSelectPlottables,true);
Set the elements to selectable.
This can be enabled in the setInteraction function.
customplot->graph()->setSelected(bool);
You can use setSelected to set whether an element can be selected.
customplot->deselectAll();
Deselect all selected items.
The attributes of the selected elements can be set as follows:
QCPGraph::setSelectedPen, QCPGraph::setSelectedBrush, QCPAxis::setSelectedLabelFont, QCPAxis::setSelectedBasePen, QCPItemText::setSelectedColor
QCPAxis is composed of scales, values, and labels. Each part can be selected separately:
customplot->xAxis->setSelectableParts();
The parameter can be
QCPAxis::spNone, QCPAxis::spAxis, QCPAxis::spTickLabels, and QCPAxis::spAxisLabel
.
QCustomPlot supports low-level response signals, such:
QCustomPlot::mouseDoubleClick, mousePress, mouseMove, mouseRelease, and mouseWheel
And advanced, such:
QCustomPlot::plottableClick, plottableDoubleClick, itemClick, itemDoubleClick, axisClick, axisDoubleClick, legendClick, legendDoubleClick, titleClick, and titleDoubleClick