QCustomPlot Discussion and Comments

How to drag a graph only horizontally (for "x" axis)Return to overview


For the moment, for dragging I use:

ui->customPlot->setInteraction(QCP::iRangeDrag, true);

This will let me drag graph on both axes.
I want to use constant values for Y axis, so I did not want to be able to drag that.
Is any way I can disable drag on Y axis?

Thank you, Maria.

You'll need to call this function for each of the QCPAxisRect you want to apply this function :



foreach(QCPAxisRect *rect, ui->customPlot->axisRects())

Thank you, this worked for me.