File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ export default {
8989
9090Sets custom time range.
9191
92- * ** Arguments** : t1 (Number) Left-bound of the range
93- * ** Arguments** : t2 (Number) Right-bound of the range
92+ * ** Arguments** : t1 (Number) Left-bound of the range | Index (in IB mode)
93+ * ** Arguments** : t2 (Number) Right-bound of the range | Index (in IB mode)
9494
9595* Example:*
9696
@@ -120,7 +120,7 @@ Gets current timerange.
120120
121121Goto to a specific timestamp
122122
123- * ** Arguments** : t (Number) Target timestamp
123+ * ** Arguments** : t (Number) Target timestamp | Index (in IB mode)
124124
125125### getCursor()
126126
Original file line number Diff line number Diff line change @@ -276,8 +276,9 @@ export default {
276276 setRange (t1 , t2 ) {
277277 if (this .chart_props .ib ) {
278278 const ti_map = this .$refs .chart .ti_map
279- t1 = ti_map .smth2i (t1)
280- t2 = ti_map .smth2i (t2)
279+ const ohlcv = this .$refs .chart .ohlcv
280+ t1 = ti_map .gt2i (t1, ohlcv)
281+ t2 = ti_map .gt2i (t2, ohlcv)
281282 }
282283 this .$refs .chart .setRange (t1, t2)
283284 },
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export default {
122122
123123 // Fast filter. Really fast, like 10X
124124 fast_filter ( arr , t1 , t2 ) {
125- if ( ! arr . length ) return arr
125+ if ( ! arr . length ) return [ arr , undefined ]
126126 try {
127127 let ia = new IndexedArray ( arr , "0" )
128128 let res = ia . getRange ( t1 , t2 )
@@ -139,7 +139,7 @@ export default {
139139
140140 // Fast filter (index-based)
141141 fast_filter_i ( arr , t1 , t2 ) {
142- if ( ! arr . length ) return arr
142+ if ( ! arr . length ) return [ arr , undefined ]
143143 let i1 = Math . floor ( t1 )
144144 if ( i1 < 0 ) i1 = 0
145145 let i2 = Math . floor ( t2 + 1 )
You can’t perform that action at this time.
0 commit comments