QCustomPlot Discussion and Comments

Selecting a rectangleReturn to overview

Hi
with regards
How can i implement selecting a region(rectangle)of a graph to zoom only that region?

It's quiet easy to add a rect zoomer :

_p_plot = new QCustomPlot();
_p_plot->addGraph();
_p_plot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
_p_plot->axisRect()->setRangeDrag(Qt::Horizontal);
_p_plot->axisRect()->setRangeZoom(Qt::Horizontal);
_p_plot->axisRect()->setRangeZoomAxes(_p_plot->xAxis, NULL); //To block y axis zoom NULL axis as horizontal
_p_plot->setSelectionRectMode(QCP::srmZoom);