| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0a3a19a commit cfd2dd6
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1493,7 +1493,7 @@ def plot(x, y=None, color=None, width=1, ax=None, style=None, legend=None, zooms | |||
| 1493 | 1493 | _set_datasrc(ax, datasrc) | |
| 1494 | 1494 | if legend is not None: | |
| 1495 | 1495 | _create_legend(ax) | |
| 1496 | - x = datasrc.x if datasrc.standalone or not ax.vb.x_indexed else datasrc.index | ||
| 1496 | + x = datasrc.x if not ax.vb.x_indexed else datasrc.index | ||
| 1497 | 1497 | y = datasrc.y / ax.vb.yscale.scalef | |
| 1498 | 1498 | if style is None or any(ch in style for ch in '-_.'): | |
| 1499 | 1499 | connect_dots = 'finite' # same as matplotlib; use datasrc.standalone=True if you want to keep separate intervals on a plot | |
@@ -2062,6 +2062,11 @@ def _set_datasrc(ax, datasrc, addcols=True): | |||
| 2062 | 2062 | else: | |
| 2063 | 2063 | viewbox.standalones.add(datasrc) | |
| 2064 | 2064 | datasrc.update_init_x(viewbox.init_steps) | |
| 2065 | + if datasrc.timebased() and viewbox.datasrc is not None: | ||
| 2066 | + ## print('WARNING: re-indexing standalone, time-based plot') | ||
| 2067 | + vdf = viewbox.datasrc.df | ||
| 2068 | + d = {v:k for k,v in enumerate(vdf[vdf.columns[0]])} | ||
| 2069 | + datasrc.df.index = [d[i] for i in datasrc.df[datasrc.df.columns[0]]] | ||
| 2065 | 2070 | ## if not viewbox.x_indexed: | |
| 2066 | 2071 | ## _set_x_limits(ax, datasrc) | |
| 2067 | 2072 | # update period if this datasrc has higher time resolution | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -259,6 +259,7 @@ def change_asset(*args, **kwargs): | |||
| 259 | 259 | ||
| 260 | 260 | symbol = ctrl_panel.symbol.currentText() | |
| 261 | 261 | interval = ctrl_panel.interval.currentText() | |
| 262 | + ws.close() | ||
| 262 | 263 | ws.df = None | |
| 263 | 264 | df = load_price_history(symbol, interval=interval) | |
| 264 | 265 | ws.reconnect(symbol, interval, df) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments