This commit is contained in:
Axel Kohlmeyer
2023-10-26 12:20:47 -04:00
parent ed4ae0a26c
commit 1e533d6496

View File

@ -300,20 +300,7 @@ void ChartViewer::add_data(int step, double data)
if (last_step < step) {
last_step = step;
series->append(step, data);
auto points = series->points();
qreal xmin = 1.0e100;
qreal xmax = -1.0e100;
qreal ymin = 1.0e100;
qreal ymax = -1.0e100;
for (auto &p : points) {
xmin = qMin(xmin, p.x());
xmax = qMax(xmax, p.x());
ymin = qMin(ymin, p.y());
ymax = qMax(ymax, p.y());
}
xaxis->setRange(xmin, xmax);
yaxis->setRange(ymin, ymax);
reset_zoom();
}
}