diff --git a/src/plotmanager.cpp b/src/plotmanager.cpp --- a/src/plotmanager.cpp +++ b/src/plotmanager.cpp @@ -260,7 +260,7 @@ void PlotManager::addCurve(QString title { auto curve = new QwtPlotCurve(title); auto series = new FrameBufferSeries(buffer); - series->setXAxis(false, 100, 500); + series->setXAxis(_xAxisAsIndex, _xMin, _xMax); curve->setSamples(series); _addCurve(curve); } @@ -417,6 +417,20 @@ void PlotManager::setYAxis(bool autoScal } } +void PlotManager::setXAxis(bool asIndex, double xMin, double xMax) +{ + _xAxisAsIndex = asIndex; + _xMin = xMin; + _xMax = xMax; + for (auto curve : curves) + { + // TODO: what happens when addCurve(QVector) is used? + FrameBufferSeries* series = static_cast(curve->data()); + series->setXAxis(asIndex, xMin, xMax); + } + replot(); +} + void PlotManager::flashSnapshotOverlay() { for (auto plot : plotWidgets)