diff --git a/re/graphingwindow.cpp b/re/graphingwindow.cpp index 5934414..647047c 100644 --- a/re/graphingwindow.cpp +++ b/re/graphingwindow.cpp @@ -1225,7 +1225,7 @@ void GraphingWindow::showParamsDialog(int idx = -1) //create a new graph with the returned parameters. GraphParams params; thisDialog->getParams(params); - createGraph(params); + createGraph(params, true, false); } delete thisDialog; } @@ -1322,7 +1322,7 @@ void GraphingWindow::appendToGraph(GraphParams ¶ms, CANFrame &frame, QVector } } -void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) +void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam, bool recalcY) { int64_t tempVal; //64 bit temp value. double yminval=10000000.0, ymaxval = -1000000.0; @@ -1561,8 +1561,10 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) ui->graphingView->xAxis->setRange(xminval, xmaxval); ui->graphingView->axisRect()->setupFullAxesBox(); } - //always recalculate Y range so that new graphs actually show up in view - ui->graphingView->yAxis->setRange(yminval, ymaxval); + //almost always recalculate Y range so that new graphs actually show up in view + if (recalcY) { + ui->graphingView->yAxis->setRange(yminval, ymaxval); + } ui->graphingView->replot(); } diff --git a/re/graphingwindow.h b/re/graphingwindow.h index 0735153..d82584a 100644 --- a/re/graphingwindow.h +++ b/re/graphingwindow.h @@ -56,7 +56,7 @@ public: void showEvent(QShowEvent*); public slots: - void createGraph(GraphParams ¶ms, bool createGraphParam = true); + void createGraph(GraphParams ¶ms, bool createGraphParam = true, bool recalcY = true); private slots: void titleDoubleClick(QMouseEvent *event, QCPTextElement *title);