From b1d3f18808f506025fc23d6b2264c39a1bc47ed0 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 21 Mar 2022 15:27:46 -0400 Subject: [PATCH] Call default view on symbol switch --- piker/ui/_chart.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index c5547102..828a3c70 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -240,6 +240,12 @@ class GodWidget(QWidget): # resume feeds *after* rendering chart view asap chart.resume_all_feeds() + # TODO: we need a check to see if the chart + # last had the xlast in view, if so then shift so it's + # still in view, if the user was viewing history then + # do nothing yah? + chart.default_view() + self.linkedsplits = linkedsplits symbol = linkedsplits.symbol if symbol is not None: @@ -904,7 +910,7 @@ class ChartPlotWidget(pg.PlotWidget): brange = l, lbar, rbar, r = self.bars_range() marker_pos, l1_len = self.pre_l1_xs() - end = xlast + l1_len + end = xlast + l1_len + 1 if ( rbar < 0