Highcharts.setOptions({lang:{rangeSelectorZoom:"",rangeSelectorFrom:((lang=="en")?"From":"由"),rangeSelectorTo:((lang=="en")?"To":"至"),noData:((lang=="en")?"No Related Information":"沒有相關資料"),}});var ivChart={chart:null,mode:"desktop",init:function(code,cratio,issuer,callback){var self=this;self.mode=(window.innerWidth<991)?"mobile":"desktop";$.getJSON('/?q=/'+lang+'/data/chart/ivChart/code/'+code,function(_data){var data=self.decode(_data);$('#ivChartContainer').highcharts('StockChart',self.getJSON(data),function(chart){self.chart=chart;self.drawBackground()})})},decode:function(_data){return _data.mainData},colors:{line1:"#007DB7",line2:"#DC6801",bar1:"#FDCD07",bar2:"#184ABD",bar3:"#77C07B"},margin:{mobile:40,desktop:90},chartheight:{mobile:230,desktop:295},getJSON:function(data){var close=[];var iv=[];var bar1=[];var bar2=[];var bar3=[];for(i=0;i';_html+='
'+self.labels[lang].yTitle1Tooltip+': '+this.points[0].y+'';_html+='
'+self.labels[lang].yTitle2Tooltip+': '+(this.points[1].y).toFixed(3);return _html}},rangeSelector:{selected:1,height:55,buttons:[{type:'day',count:5,text:self.labels[lang].day5},{type:'month',count:1,text:self.labels[lang].month1},{type:'month',count:2,text:self.labels[lang].month2},{type:'month',count:3,text:self.labels[lang].month3}],allButtonsEnabled:true,inputBoxHeight:20,inputBoxWidth:100,inputDateFormat:'%d-%m-%Y',buttonPosition:{x:0,},inputPosition:{x:270*((self.mode=="desktop")?1:-1),y:2,align:"left"},inputStyle:{"fontSize":"14px",},labelStyle:{"fontSize":"14px",},buttonSpacing:0,buttonTheme:{fill:'none',padding:6,width:((lang=="en")?50:30),stroke:'#FFCC07','stroke-width':1,style:{color:'#000',fontWeight:'bold'},states:{select:{fill:'#FFCC07',stroke:'#FFCC07',},hover:{fill:'#FFCC07',stroke:'#FFCC07',}}},},xAxis:{type:'datetime',lineWidth:0,gridLineWidth:0,tickColor:'#00000000',lineColor:'#00000000',labels:{style:{color:"#000"},y:self.mode=="mobile"?-60:0,formatter:function(){return Highcharts.dateFormat('%d/%m',this.value)}}},yAxis:[{title:{text:self.mode=="mobile"?null:this.labels[lang].yTitle1,rotation:((lang=="en")?-90:0),y:((lang=="en")?0:-30),margin:20,useHTML:true,style:{color:"#000"}},labels:{align:'left',x:10,y:5,style:{color:"#000"},formatter:function(){return this.value.toFixed(3)}},tickAmount:7,showFirstLabel:false,showLastLabel:false,height:self.chartheight[self.mode],},{title:{text:self.mode=="mobile"?null:this.labels[lang].yTitle2,useHTML:true,rotation:((lang=="en")?-90:0),y:((lang=="en")?0:-30),margin:20,style:{color:"#000"}},labels:{align:'right',x:-10,y:5,style:{color:"#000"},formatter:function(){return(this.value).toFixed(1)}},tickAmount:7,showFirstLabel:false,showLastLabel:false,gridLineWidth:0,opposite:false,height:self.chartheight[self.mode],},],navigator:{enabled:false,},scrollbar:{enabled:false},series:[{name:this.labels[lang].legend1,data:close,color:this.colors["line1"],},{name:this.labels[lang].legend2,data:iv,yAxis:1,color:this.colors["line2"],},],exporting:{enabled:false}}},redraw:function(){var chart=this.chart;var offsetx,offsety;var self=this;$("#chartBackground1").remove();$("#chartLegend1").remove();$("#chartLegend2").remove();$("#chartFlag1").remove();$("#chartFlag2").remove();chart.renderer.rect(self.margin[self.mode],55,chart.plotWidth,self.chartheight[self.mode],0).attr({fill:'#F9F9F9',stroke:'#C0C0C0','stroke-width':1,id:'chartBackground1',}).add();offsetx=self.margin[self.mode];offsety=55;chart.renderer.rect(offsetx+15,offsety+13,15,2,0).attr({fill:this.colors["line1"],'stroke-width':0,id:'chartFlag1',}).add();chart.renderer.text(this.labels[lang].legend1,offsetx+35,offsety+18).css({fontSize:'12px'}).attr({id:'chartLegend1',}).add();chart.renderer.rect(self.mode=="mobile"?offsetx+15:offsetx+15+100,self.mode=="mobile"?offsety+13+13+9:offsety+13,15,2,0).attr({fill:this.colors["line2"],'stroke-width':0,id:'chartFlag2',}).add();chart.renderer.text(this.labels[lang].legend2,self.mode=="mobile"?offsetx+35:offsetx+35+100,self.mode=="mobile"?offsety+18+18+4:offsety+18).css({fontSize:'12px'}).attr({id:'chartLegend2',}).add()},drawBackground:function(){var chart=this.chart;var offsetx,offsety;var self=this;this.redraw()},labels:{tc:{day5:'5日',month1:'1個月',month2:'2個月',month3:'3個月',yTitle1:"






",yTitle2:"




%
",yTitle3:"Outstanding Quantity (%)",yTitle1Tooltip:"認股證價格(元)",yTitle2Tooltip:"引伸波幅(%)",yTitle3:"Outstanding Quantity (%)",legend1:"認股證價格",legend2:"引伸波幅",legend3:"LP Bought",legend4:"LP Sold",legend5:"Market Volume",million:"Million",},sc:{day5:'5日',month1:'1个月',month2:'2个月',month3:'3个月',yTitle1:"






",yTitle2:"




%
",yTitle3:"Outstanding Quantity (%)",yTitle1Tooltip:"认股证价格(元)",yTitle2Tooltip:"引伸波幅(%)",yTitle3:"Outstanding Quantity (%)",legend1:"认股证价格",legend2:"引伸波幅",legend3:"LP Bought",legend4:"LP Sold",legend5:"Market Volume",million:"Million",},en:{day5:'5Days',month1:'1Month',month2:'2Months',month3:'3Months',yTitle1:"Warrant Price",yTitle2:"Implied Volatility(%)",yTitle3:"Outstanding Quantity (%)",yTitle1Tooltip:"Warrant Price",yTitle2Tooltip:"Implied Volatility(%)",yTitle3:"Outstanding Quantity (%)",legend1:"Warrant Price",legend2:"Implied Volatility",legend3:"LP Bought",legend4:"LP Sold",legend5:"Market Volume",million:"Million",},},}