cabana: show enum string in chart tooltip (#32303)

old-commit-hash: 37877185f8
This commit is contained in:
Dean Lee 2024-04-28 07:31:48 +08:00 committed by GitHub
parent 938759ebd1
commit 65660350dd
1 changed files with 1 additions and 1 deletions

View File

@ -581,7 +581,7 @@ void ChartView::showTip(double sec) {
// use reverse iterator to find last item <= sec.
auto it = std::lower_bound(s.vals.crbegin(), s.vals.crend(), sec, [](auto &p, double x) { return p.x() > x; });
if (it != s.vals.crend() && it->x() >= axis_x->min()) {
value = QString::number(it->y());
value = s.sig->formatValue(it->y(), false);
s.track_pt = *it;
x = std::max(x, chart()->mapToPosition(*it).x());
}