var OSStatisticChart={mode:"desktop",init:function(wtype,callback){var self=this;self.mode=(window.innerWidth<991)?"mobile":"desktop";self.wtype=wtype;$.getJSON('/'+lang+'/data/chart/OSStatisticChart/wtype/'+wtype,function(_data){var data=self.decode(_data);$('#OSStatisticChartContainer').highcharts(self.getJSON(data,wtype),function(){if(callback!==undefined){callback(chart,data)}})})},decode:function(_data){return _data.mainData},getJSON:function(data,wtype){var self=this;return{chart:{plotBackgroundColor:null,plotBorderWidth:null,plotShadow:false,type:'pie',},title:{text:null},tooltip:{pointFormat:self.labels[lang][self.wtype].text2+'{point.percentage:.2f}%
'+self.labels[lang][self.wtype].text3+'{point.y:.0f}'},plotOptions:{pie:{size:'100%',allowPointSelect:false,cursor:'pointer',dataLabels:{enabled:((self.mode=="desktop")?true:false),format:'{point.percentage:.2f}%',style:{color:(Highcharts.theme&&Highcharts.theme.contrastTextColor)||'black'}},showInLegend:true,colors:["#00A0D6","#6BC06C","#FDE18A","#949599","#AED8AC","#FCD33D","#066AA3","#FCBF7D","#C4EAF7","#EF7234"],borderWidth:0}},legend:{title:{text:self.labels[lang][self.wtype].text1,},enabled:true,layout:((self.mode=="desktop")?'vertical':'horizontal'),align:((self.mode=="desktop")?'right':'center'),verticalAlign:((self.mode=="desktop")?'middle':'bottom'),labelFormatter:function(){return this.name+" "+addcomma((this.y*1).toFixed(0))},itemMarginBottom:((self.mode=="desktop")?15:0),},series:[{colorByPoint:true,data:data}],exporting:{enabled:false},}},labels:{en:{warrant:{text1:"Outstanding Qty(Million shares)",text2:"Change in Outstanding Qty of Warrants(%): ",text3:"Outstanding Qty of Warrants(Million shares): ",},cbbc:{text1:"Outstanding Qty(Million shares)",text2:"Change in Outstanding Qty of CBBC(%): ",text3:"Outstanding Qty of CBBC(Million shares): ",}},sc:{warrant:{text1:"街货量(百万份)",text2:"股证街货量比例(%): ",text3:"股证街货量(百万份): ",},cbbc:{text1:"街货量(百万份)",text2:"牛证街货量比例(%): ",text3:"牛证街货量(百万份): ",}},tc:{warrant:{text1:"街貨量(百萬份)",text2:"股證街貨量比例(%): ",text3:"股證街貨量(百萬份): ",},cbbc:{text1:"街貨量(百萬份)",text2:"牛證街貨量比例(%): ",text3:"牛證街貨量(百萬份): ",}},},}