@@ -17,10 +17,10 @@ export class HomeComponent extends AppComponentBase implements AfterViewInit {
1717 ngAfterViewInit ( ) : void {
1818
1919 $ ( function ( ) {
20- //Widgets count
20+ // Widgets count
2121 $ ( '.count-to' ) . countTo ( ) ;
2222
23- //Sales count to
23+ // Sales count to
2424 $ ( '.sales-count-to' ) . countTo ( {
2525 formatter : function ( value , options ) {
2626 return '$' + value . toFixed ( 2 ) . replace ( / ( \d ) (? = ( \d \d \d ) + (? ! \d ) ) / g, ' ' ) . replace ( '.' , ',' ) ;
@@ -32,10 +32,10 @@ export class HomeComponent extends AppComponentBase implements AfterViewInit {
3232 initSparkline ( ) ;
3333 } ) ;
3434
35- var realtime = 'on' ;
35+ let realtime = 'on' ;
3636 function initRealTimeChart ( ) {
37- //Real time ==========================================================================================
38- var plot = ( $ as any ) . plot ( '#real_time_chart' , [ getRandomData ( ) ] , {
37+ // Real time ==========================================================================================
38+ let plot = ( $ as any ) . plot ( '#real_time_chart' , [ getRandomData ( ) ] , {
3939 series : {
4040 shadowSize : 0 ,
4141 color : 'rgb(0, 188, 212)'
@@ -62,7 +62,7 @@ export class HomeComponent extends AppComponentBase implements AfterViewInit {
6262 plot . setData ( [ getRandomData ( ) ] ) ;
6363 plot . draw ( ) ;
6464
65- var timeout ;
65+ let timeout ;
6666 if ( realtime === 'on' ) {
6767 timeout = setTimeout ( updateRealTime , 320 ) ;
6868 } else {
@@ -76,12 +76,12 @@ export class HomeComponent extends AppComponentBase implements AfterViewInit {
7676 realtime = ( this as any ) . checked ? 'on' : 'off' ;
7777 updateRealTime ( ) ;
7878 } ) ;
79- //====================================================================================================
79+ // ====================================================================================================
8080 }
8181
8282 function initSparkline ( ) {
83- $ ( " .sparkline" ) . each ( function ( ) {
84- var $this = $ ( this ) ;
83+ $ ( ' .sparkline' ) . each ( function ( ) {
84+ let $this = $ ( this ) ;
8585 $this . sparkline ( 'html' , $this . data ( ) ) ;
8686 } ) ;
8787 }
@@ -108,24 +108,24 @@ export class HomeComponent extends AppComponentBase implements AfterViewInit {
108108 } ] ,
109109 colors : [ 'rgb(233, 30, 99)' , 'rgb(0, 188, 212)' , 'rgb(255, 152, 0)' , 'rgb(0, 150, 136)' , 'rgb(96, 125, 139)' ] ,
110110 formatter : function ( y ) {
111- return y + '%'
111+ return y + '%' ;
112112 }
113113 } ) ;
114114 }
115115
116- var data = [ ] , totalPoints = 110 ;
116+ let data = [ ] , totalPoints = 110 ;
117117 function getRandomData ( ) {
118- if ( data . length > 0 ) data = data . slice ( 1 ) ;
118+ if ( data . length > 0 ) { data = data . slice ( 1 ) ; }
119119
120120 while ( data . length < totalPoints ) {
121- var prev = data . length > 0 ? data [ data . length - 1 ] : 50 , y = prev + Math . random ( ) * 10 - 5 ;
121+ let prev = data . length > 0 ? data [ data . length - 1 ] : 50 , y = prev + Math . random ( ) * 10 - 5 ;
122122 if ( y < 0 ) { y = 0 ; } else if ( y > 100 ) { y = 100 ; }
123123
124124 data . push ( y ) ;
125125 }
126126
127- var res = [ ] ;
128- for ( var i = 0 ; i < data . length ; ++ i ) {
127+ let res = [ ] ;
128+ for ( let i = 0 ; i < data . length ; ++ i ) {
129129 res . push ( [ i , data [ i ] ] ) ;
130130 }
131131
0 commit comments