File tree 3 files changed +8
-7
lines changed
3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ export default {
89
89
90
90
Sets custom time range.
91
91
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)
94
94
95
95
* Example:*
96
96
@@ -120,7 +120,7 @@ Gets current timerange.
120
120
121
121
Goto to a specific timestamp
122
122
123
- * ** Arguments** : t (Number) Target timestamp
123
+ * ** Arguments** : t (Number) Target timestamp | Index (in IB mode)
124
124
125
125
### getCursor()
126
126
Original file line number Diff line number Diff line change @@ -276,8 +276,9 @@ export default {
276
276
setRange (t1 , t2 ) {
277
277
if (this .chart_props .ib ) {
278
278
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)
281
282
}
282
283
this .$refs .chart .setRange (t1, t2)
283
284
},
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export default {
122
122
123
123
// Fast filter. Really fast, like 10X
124
124
fast_filter ( arr , t1 , t2 ) {
125
- if ( ! arr . length ) return arr
125
+ if ( ! arr . length ) return [ arr , undefined ]
126
126
try {
127
127
let ia = new IndexedArray ( arr , "0" )
128
128
let res = ia . getRange ( t1 , t2 )
@@ -139,7 +139,7 @@ export default {
139
139
140
140
// Fast filter (index-based)
141
141
fast_filter_i ( arr , t1 , t2 ) {
142
- if ( ! arr . length ) return arr
142
+ if ( ! arr . length ) return [ arr , undefined ]
143
143
let i1 = Math . floor ( t1 )
144
144
if ( i1 < 0 ) i1 = 0
145
145
let i2 = Math . floor ( t2 + 1 )
You can’t perform that action at this time.
0 commit comments