Highcharts.setOptions({lang:{rangeSelectorZoom:"",noData:"沒有相關資料",}});var turnoverChart={chart:null,type:null,init:function(type){var self=this;this.type=type;$.getJSON('/?q=/'+lang+'/data/chart/turnoverChart/type/'+type,function(_data){var data=self.decode(_data);self.type=type;$('#turnoverChartContainer').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"},getJSON:function(data){var market=data.market;var pturnover=data.pturnover;var self=this;return{chart:{marginLeft:60,marginRight:120,spacingTop:0,events:{redraw:function(event){self.drawBackground()}}},plotOptions:{line:{events:{legendItemClick:function(){return false}}}},tooltip:{useHTML:true,formatter:function(){var _html='
'+Highcharts.dateFormat('%d-%m-%Y',this.x)+'';_html+='
'+self.labels[lang][self.type].yTitle1Tooltip+': '+addcomma(this.points[1].y)+'';_html+='
'+self.labels[lang].yTitle2Tooltip+': '+addcomma(this.points[0].y)+'';return _html}},rangeSelector:{selected:1,height:55,buttons:[{type:'day',count:10,text:this.labels[lang].rangeselector[0],},{type:'day',count:25,text:this.labels[lang].rangeselector[1],},{type:'day',count:50,text:this.labels[lang].rangeselector[2],},{type:'day',count:200,text:this.labels[lang].rangeselector[3],},],allButtonsEnabled:true,inputBoxHeight:20,inputBoxWidth:100,inputDateFormat:'%Y-%m-%d',buttonPosition:{x:0,},inputPosition:{x:-270,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"},formatter:function(){return Highcharts.dateFormat('%d/%m',this.value)}}},yAxis:[{title:{text:this.labels[lang].yTitle2,rotation:((lang=="en")?-90:0),y:((lang=="en")?0:-70),margin:18,useHTML:true,style:{color:"#000"}},labels:{align:'left',x:10,y:5,style:{color:"#000"},formatter:function(){return addcomma(this.value)}},tickAmount:7,showFirstLabel:false,showLastLabel:false,height:295,},{title:{text:this.labels[lang][self.type].yTitle1,rotation:((lang=="en")?-90:0),y:((lang=="en")?0:-70),margin:45,useHTML:true,style:{color:"#000"}},labels:{align:'left',x:-30,y:5,style:{color:"#000"},formatter:function(){return addcomma(this.value)}},tickAmount:7,showFirstLabel:false,showLastLabel:false,height:295,opposite:false,}],navigator:{enabled:false,},scrollbar:{enabled:false},series:[{name:this.labels[lang].legend2,data:data.market,color:this.colors["line2"],type:'column',},{name:this.labels[lang][self.type].legend1,data:data.pturnover,color:this.colors["line1"],yAxis:1,}],exporting:{enabled:false}}},drawBackground:function(){var chart=this.chart;var offsetx,offsety;$("#chartBackground").remove();$("#drawLegendLine").remove();$("#drawLegendText").remove();offsetx=60;offsety=55;chart.renderer.rect(offsetx,offsety,chart.plotWidth,295,0).attr({fill:'#F9F9F9',stroke:'#C0C0C0','stroke-width':1,id:'chartBackground',}).add();chart.renderer.rect(offsetx+15,offsety+13,15,2,0).attr({fill:this.colors["line1"],'stroke-width':0,id:'drawLegendLine',}).add();chart.renderer.text(this.labels[lang][this.type].legend1,offsetx+35,offsety+18).css({fontSize:'12px',id:'drawLegendText',}).add();chart.renderer.rect(offsetx+15+140,offsety+13,15,2,0).attr({fill:this.colors["line2"],'stroke-width':0,}).add();chart.renderer.text(this.labels[lang].legend2,offsetx+35+140,offsety+18).css({fontSize:'12px'}).add()},labels:{tc:{cbbc:{yTitle1:"







",yTitle1Tooltip:"牛熊證總成交(%)",legend1:"牛熊證總成交",},warrant:{yTitle1:"







",yTitle1Tooltip:"認股證總成交(%)",legend1:"認股證總成交",},all:{yTitle1:"






",yTitle1Tooltip:"輪證總成交(%)",legend1:"輪證總成交",},yTitle2:"







",yTitle2Tooltip:"大市總成交(百萬)",legend2:"大市總成交",rangeselector:["10日","25日","50日","200日"],},sc:{cbbc:{yTitle1:"







",yTitle1Tooltip:"牛熊证总成交(%)",legend1:"牛熊证总成交",},warrant:{yTitle1:"







",yTitle1Tooltip:"认股证总成交(%)",legend1:"认股证总成交",},all:{yTitle1:"






",yTitle1Tooltip:"轮证总成交(%)",legend1:"轮证总成交",},yTitle2:"







",yTitle2Tooltip:"大市总成交(百萬)",legend2:"大市总成交",rangeselector:["10日","25日","50日","200日"],},en:{cbbc:{yTitle1:"CBBCs Turnover(%)",yTitle1Tooltip:"CBBCs Turnover(%)",legend1:"CBBCs Turnover",},warrant:{yTitle1:"Warrants Turnover(%)",yTitle1Tooltip:"Warrants Turnover(%)",legend1:"Warrants Turnover",},all:{yTitle1:"Warrants & CBBCs Turnover(%)",yTitle1Tooltip:"Warrants & CBBCs Turnover(%)",legend1:"Warrants & CBBCs Turnover",},yTitle2:"Total Market Turnover (Million HKD)",yTitle2Tooltip:"Total Market Turnover (Million HKD)",legend2:"Total Market Turnover",rangeselector:["10Days","25Days","50Days","200Days"],},},}