|
|
@ -562,6 +562,9 @@ void ChartView::updateSeries(const Signal *sig, const std::vector<Event *> *even |
|
|
|
if (events->size()) { |
|
|
|
if (events->size()) { |
|
|
|
s.last_value_mono_time = events->back()->mono_time; |
|
|
|
s.last_value_mono_time = events->back()->mono_time; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!can->liveStreaming()) { |
|
|
|
|
|
|
|
s.segment_tree.build(s.vals); |
|
|
|
|
|
|
|
} |
|
|
|
s.series->replace(series_type == SeriesType::StepLine ? s.step_vals : s.vals); |
|
|
|
s.series->replace(series_type == SeriesType::StepLine ? s.step_vals : s.vals); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -586,9 +589,15 @@ void ChartView::updateAxisY() { |
|
|
|
|
|
|
|
|
|
|
|
auto first = std::lower_bound(s.vals.begin(), s.vals.end(), axis_x->min(), [](auto &p, double x) { return p.x() < x; }); |
|
|
|
auto first = std::lower_bound(s.vals.begin(), s.vals.end(), axis_x->min(), [](auto &p, double x) { return p.x() < x; }); |
|
|
|
auto last = std::lower_bound(first, s.vals.end(), axis_x->max(), [](auto &p, double x) { return p.x() < x; }); |
|
|
|
auto last = std::lower_bound(first, s.vals.end(), axis_x->max(), [](auto &p, double x) { return p.x() < x; }); |
|
|
|
for (auto it = first; it != last; ++it) { |
|
|
|
if (can->liveStreaming()) { |
|
|
|
if (it->y() < min) min = it->y(); |
|
|
|
for (auto it = first; it != last; ++it) { |
|
|
|
if (it->y() > max) max = it->y(); |
|
|
|
if (it->y() < min) min = it->y(); |
|
|
|
|
|
|
|
if (it->y() > max) max = it->y(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
auto [min_y, max_y] = s.segment_tree.minmax(std::distance(s.vals.begin(), first), std::distance(s.vals.begin(), last)); |
|
|
|
|
|
|
|
min = std::min(min, min_y); |
|
|
|
|
|
|
|
max = std::max(max, max_y); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (min == std::numeric_limits<double>::max()) min = 0; |
|
|
|
if (min == std::numeric_limits<double>::max()) min = 0; |
|
|
|