Use structure array indexing syntax
parent
db76443389
commit
4aa526f400
|
@ -62,7 +62,7 @@ class DynamicDateAxis(pg.AxisItem):
|
||||||
for ibar in values:
|
for ibar in values:
|
||||||
if ibar > quotes_count:
|
if ibar > quotes_count:
|
||||||
return strings
|
return strings
|
||||||
dt_tick = fromtimestamp(bars[int(ibar)].time)
|
dt_tick = fromtimestamp(bars[int(ibar)]['time'])
|
||||||
strings.append(
|
strings.append(
|
||||||
dt_tick.strftime(self.tick_tpl[s_period])
|
dt_tick.strftime(self.tick_tpl[s_period])
|
||||||
)
|
)
|
||||||
|
@ -146,7 +146,7 @@ class XAxisLabel(AxisLabel):
|
||||||
bars = self.parent.linked_charts._array
|
bars = self.parent.linked_charts._array
|
||||||
if tick_pos > len(bars):
|
if tick_pos > len(bars):
|
||||||
return 'Unknown Time'
|
return 'Unknown Time'
|
||||||
return fromtimestamp(bars[round(tick_pos)].time).strftime(tpl)
|
return fromtimestamp(bars[round(tick_pos)]['time']).strftime(tpl)
|
||||||
|
|
||||||
def boundingRect(self): # noqa
|
def boundingRect(self): # noqa
|
||||||
return QtCore.QRectF(0, 0, 145, 50)
|
return QtCore.QRectF(0, 0, 145, 50)
|
||||||
|
|
Loading…
Reference in New Issue