QCustomPlot Discussion and Comments

How to map the horizontal slider with the yAxis zooming in QCustomPlotReturn to overview

I have aHorizontal slider with a range of 0 - 90 . when the slider is dragged the graph also should be zommed along the Y axis , How this can be carried out ?

Check out the Range control with Scrollbar tutorial (under special use cases). That should get you going.

Would there be any specific examples, I am not able to relate the scroll bar with the Slider

I tried similar to that of the scroll bar but it didnt have an effect.

code :

 
connect(ui->horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(slt_Hori(int)));

void MainWindow::slt_Hori(int value)
{
    if (qAbs(ui->plotaz_3->yAxis->range().center()+value/100.0) > 0.01) // if user is dragging plot, we don't want to replot twice
      {
        qDebug("Insode");
        ui->plotaz_3->yAxis->setRange(-value/100.0, ui->plotaz_3->yAxis->range().size(), Qt::AlignCenter);
        ui->plotaz_3->replot();
      }
}