QCustomPlot - scale every axis individually



  • I have developed quite good working scada app.

    I would like to have a feature that every graph is scalled individually.

    I have tried by adding indixidual y axis for every graph, but I found difficulty later to set scale factor.

      QCPAxis *ax =  ui->customPlot->axisRect()->addAxis(QCPAxis::atLeft);
      //ax->setVisible(false);
      ax->setRange(INIT_Y_MIN, INIT_Y_MAX);
      scaleRatios.insert(scaleRatios.begin()+num,1.0);
      connect(ui->customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), ax, SLOT(setRange(QCPRange)));
      scaleAxes.insert(scaleAxes.begin()+num, ax);
    
      ui->customPlot->addGraph(axisX,ax);
    

    Any suggestions how to solve that?

    Best regards,
    Chris


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.