@@ -39,6 +39,8 @@ const TickDisplay = (() => {
39
39
subscribe ,
40
40
responseID ;
41
41
42
+ let id_render = 'tick_chart' ;
43
+
42
44
const initialize = ( data , options ) => {
43
45
// setting up globals
44
46
number_of_ticks = parseInt ( data . number_of_ticks ) ;
@@ -50,6 +52,9 @@ const TickDisplay = (() => {
50
52
abs_barrier = data . abs_barrier ;
51
53
display_decimals = data . display_decimals || 2 ;
52
54
show_contract_result = data . show_contract_result ;
55
+ if ( options . id_render ) {
56
+ id_render = options . id_render ;
57
+ }
53
58
54
59
if ( data . show_contract_result ) {
55
60
contract_sentiment = data . contract_sentiment ;
@@ -110,7 +115,7 @@ const TickDisplay = (() => {
110
115
chart = new Highcharts . Chart ( {
111
116
chart : {
112
117
type : 'line' ,
113
- renderTo : 'tick_chart' ,
118
+ renderTo : id_render ,
114
119
width : config . width || ( config . minimize ? 394 : null ) ,
115
120
height : config . minimize ? 143 : null ,
116
121
backgroundColor : null ,
@@ -158,7 +163,7 @@ const TickDisplay = (() => {
158
163
if ( ! show_contract_result ) {
159
164
return ;
160
165
}
161
- const chart_container = $ ( '#tick_chart' ) ;
166
+ const chart_container = $ ( `# ${ id_render } ` ) ;
162
167
if ( contract_sentiment === 'up' ) {
163
168
if ( tick . quote > contract_barrier ) {
164
169
chart_container . css ( 'background-color' , 'rgba(46,136,54,0.198039)' ) ;
@@ -283,7 +288,7 @@ const TickDisplay = (() => {
283
288
} ;
284
289
285
290
const dispatch = ( data ) => {
286
- const tick_chart = CommonFunctions . getElementById ( 'tick_chart' ) ;
291
+ const tick_chart = CommonFunctions . getElementById ( id_render ) ;
287
292
288
293
if ( ! CommonFunctions . isVisible ( tick_chart ) || ! data || ( ! data . tick && ! data . history ) ) {
289
294
return ;
0 commit comments