1
오른쪽 축을 드래그 가능하게하려고합니다.두 번째 오른쪽에 QCustomPlot 및 iRangeDrag yAxis
바로 지금 첫 번째 yAxis
을 두 번 클릭하여 드래그 할 수있는 사이트 예제 중 하나를 사용합니다.
void MainWindow::mousePress()
{
// if an axis is selected, only allow the direction of that axis to be dragged
// if no axis is selected, both directions may be dragged
if (ui->customPlot->xAxis->selectedParts().testFlag(QCPAxis::spAxis))
ui->customPlot->axisRect()->setRangeDrag(ui->customPlot->xAxis->orientation());
else if (ui->customPlot->yAxis->selectedParts().testFlag(QCPAxis::spAxis))
ui->customPlot->axisRect()->setRangeDrag(ui->customPlot->yAxis->orientation());
else if (ui->customPlot->yAxis2->selectedParts().testFlag(QCPAxis::spAxis))
ui->customPlot->axisRect()->setRangeDrag(ui->customPlot->yAxis2->orientation());
else
ui->customPlot->axisRect()->setRangeDrag(Qt::Horizontal|Qt::Vertical);
}
내 그래프에 각각 yAxis
이있는 두 행이 있습니다. 달성하고자하는 것은 yAxis2
라고하는 yAxis
의 두 번째 (오른쪽)에있는 동일한 드래그 가능한 효과입니다. yAxis2
을 선택한 경우에도 아래 코드를 사용하면 세로로 드래그되는 것은 yAxis
입니다.
왼쪽의 yAxis와 관련이있는 axisRect()에 문제가있는 것 같습니다.
누구나 아이디어가 있으십니까? – user217354