Fix axes for shm primary indexing

to_qpainterpath_and_beyond
Tyler Goodlet 2020-12-14 12:22:05 -05:00
parent c8537d59a8
commit 7ce27107df
1 changed files with 14 additions and 2 deletions

View File

@ -116,13 +116,25 @@ class DynamicDateAxis(Axis):
indexes: List[int], indexes: List[int],
) -> List[str]: ) -> List[str]:
bars = self.linked_charts.chart._ohlc # try:
chart = self.linked_charts.chart
bars = chart._ohlc
shm = self.linked_charts.chart._shm
first = shm._first.value
bars_len = len(bars) bars_len = len(bars)
times = bars['time'] times = bars['time']
epochs = times[list( epochs = times[list(
map(int, filter(lambda i: i < bars_len, indexes)) map(
int,
filter(
lambda i: i > 0 and i < bars_len,
(i-first for i in indexes)
)
)
)] )]
# TODO: **don't** have this hard coded shift to EST # TODO: **don't** have this hard coded shift to EST
dts = pd.to_datetime(epochs, unit='s') # - 4*pd.offsets.Hour() dts = pd.to_datetime(epochs, unit='s') # - 4*pd.offsets.Hour()