@@ -15,7 +15,7 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
15
15
*/
16
16
initializer : function ( ) {
17
17
var cb = this . get ( "contentBox" ) ;
18
- cb . setStyle ( " position" , "relative" ) ;
18
+ cb . _node . style . position = "relative" ;
19
19
this . _axes = [ ] ;
20
20
this . _graphs = [ ] ;
21
21
this . _graphics = [ ] ;
@@ -266,7 +266,7 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
266
266
startTimeline : function ( ) {
267
267
if ( ! this . _runTimeline ) {
268
268
this . _runTimeline = true ;
269
- this . _timelineStart = ( new Date ( ) ) . valueOf ( ) - 17 ;
269
+ this . _timelineStart = + new Date ( ) - 17 ;
270
270
this . redraw ( ) ;
271
271
}
272
272
} ,
@@ -299,7 +299,7 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
299
299
chart ,
300
300
i ,
301
301
len = charts . length ,
302
- endTime = ( new Date ( ) ) . valueOf ( ) ;
302
+ endTime = + new Date ( ) ;
303
303
if ( endTime >= this . _timelineStart + 17 ) {
304
304
for ( i = 0 ; i < len ; i = i + 1 ) {
305
305
chart = charts [ i ] ;
@@ -312,7 +312,7 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
312
312
legend . redraw ( ) ;
313
313
}
314
314
}
315
- this . _timelineStart = ( new Date ( ) ) . valueOf ( ) ;
315
+ this . _timelineStart = + new Date ( ) ;
316
316
}
317
317
if ( this . _runTimeline && ! this . _autoDraw ) {
318
318
this . _timelineId = this . _onEnterFrame . apply ( WINDOW , [ function ( ) {
@@ -375,13 +375,19 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
375
375
valueLen ,
376
376
valueKey ,
377
377
groupMarkers ,
378
- nomarkers = [ "candlestick" , "line" , "ohlc" , "volumecolumn" , "multipleline" ] ;
378
+ nomarkers = {
379
+ "candlestick" : true ,
380
+ "line" : true ,
381
+ "ohlc" : true ,
382
+ "volumecolumn" : true ,
383
+ "multipleline" : true
384
+ } ;
379
385
for ( indIter = 0 ; indIter < indLen ; indIter = indIter + 1 ) {
380
386
indicator = indicators [ indIter ] ;
381
387
valueKey = indicator . valueKey ;
382
388
indicatorType = indicator . type ;
383
389
if ( indicatorType === "candlestick" || indicatorType === "ohlc" || typeof valueKey === "string" ) {
384
- groupMarkers = Y . Array . indexOf ( nomarkers , indicatorType ) === - 1 && indicator . groupMarkers ;
390
+ groupMarkers = ! nomarkers [ indicatorType ] && indicator . groupMarkers ;
385
391
seriesConfig = {
386
392
groupMarkers : groupMarkers ,
387
393
type : indicator . type ,
@@ -398,10 +404,10 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
398
404
yKey : indicator . valueKey [ valueIter ]
399
405
} ;
400
406
if ( typeof indicatorType === "string" ) {
401
- seriesConfig . groupMarkers = Y . Array . indexOf ( nomarkers , indicatorType ) === - 1 && indicator . groupMarkers ;
407
+ seriesConfig . groupMarkers = ! nomarkers [ indicatorType ] && indicator . groupMarkers ;
402
408
seriesConfig . type = indicatorType ;
403
409
} else {
404
- seriesConfig . groupMarkers = Y . Array . indexOf ( nomarkers , indicatorType [ valueIter ] ) === - 1 && indicator . groupMarkers ;
410
+ seriesConfig . groupMarkers = ! nomarkers [ indicatorType ] && indicator . groupMarkers ;
405
411
seriesConfig . type = indicatorType [ valueIter ] ;
406
412
if ( indicatorType [ valueIter ] === "multipleline" && config . threshold && config . range === "1d" ) {
407
413
seriesConfig . thresholds = [ parseFloat ( indicator . previousClose ) ] ;
@@ -661,11 +667,12 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
661
667
numericAxis = new NumericClass ( numericConfig ) ;
662
668
dateAxis = new DateClass ( dateConfig ) ;
663
669
bb = dateAxis . get ( "boundingBox" ) ;
664
- bb . setStyle ( "left" , 0 + "px" ) ;
665
- bb . setStyle ( "top" , dateConfig . y + "px" ) ;
670
+ bb . _node . style . left = 0 ;
671
+ bb . _node . style . top = dateConfig . y + "px" ;
672
+
666
673
bb = numericAxis . get ( "boundingBox" ) ;
667
- bb . setStyle ( " left" , numericConfig . x + "px" ) ;
668
- bb . setStyle ( " top" , numericConfig . y + "px" ) ;
674
+ bb . _node . style . left = numericConfig . x + "px" ;
675
+ bb . _node . style . top = numericConfig . y + "px" ;
669
676
axes = {
670
677
numeric : numericAxis ,
671
678
date : dateAxis
@@ -843,7 +850,8 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
843
850
key ,
844
851
color ,
845
852
crosshairKey ,
846
- validKeys = config . keys ;
853
+ validKeys = Y . Array . hash ( config . keys ) ;
854
+
847
855
for ( key in graphs ) {
848
856
if ( graphs . hasOwnProperty ( key ) ) {
849
857
crosshairKey = key === "quote" ? "close" : key ;
@@ -852,7 +860,7 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
852
860
if ( color && typeof color === "object" && graph . get ( "type" ) === "combo" ) {
853
861
color = color . line ;
854
862
}
855
- if ( Y . Array . indexOf ( validKeys , crosshairKey ) > - 1 ) {
863
+ if ( validKeys [ crosshairKey ] ) {
856
864
series = {
857
865
marker : {
858
866
shape : "circle" ,
@@ -1197,15 +1205,9 @@ Y.StockIndicatorsChart = Y.Base.create("stockIndicatorsChart", Y.Widget, [Y.Ren
1197
1205
}
1198
1206
}
1199
1207
}
1200
- if ( this . _startHandle ) {
1201
- this . _startHandle . detach ( ) ;
1202
- }
1203
- if ( this . _moveHandle ) {
1204
- this . _moveHandle . detach ( ) ;
1205
- }
1206
- if ( this . _endHandle ) {
1207
- this . _endHandle . detach ( ) ;
1208
- }
1208
+ this . _startHandle . detach ( ) ;
1209
+ this . _moveHandle . detach ( ) ;
1210
+ this . _endHandle . detach ( ) ;
1209
1211
} ,
1210
1212
1211
1213
destructor : function ( ) {
0 commit comments