var errMsg={th:"",en:"No data to display"};Highcharts.setOptions({lang:{rangeSelectorZoom:"",noData:errMsg[lang],}});var sectorsChart={data_length:0,mode:"mobile",init:function(callback){var self=this;$.getJSON('/'+lang+'/data/chart/sectorsChart',function(_data){var data=self.decode(_data,'main');var indexdata=self.decode(_data,'index');if(data!=null){for(var i=0;i0){self.data_length++}}if(self.data_length==0){data=null}}$('#sectorsChartContainer').highcharts(self.getJSON(data,indexdata),function(){})})},decode:function(_data,type){var jdata;jdata=type=='main'?_data.mainData:_data.indexdata;return jdata},getJSON:function(data,indexdata){var self=this;return{chart:{plotBackgroundColor:null,plotBorderWidth:null,plotShadow:false,margin:this.mode=='desktop'?60:0,},title:{text:'
SET 100
'+indexdata+'
',align:'center',verticalAlign:'middle',useHTML:true,y:-10},tooltip:{enabled:true,useHTML:true,formatter:function(){var pchng=this.point.pchng*1;var perpchng='';if(pchng>0){perpchng='+'+pchng+'%'}else if(pchng<0){perpchng='-'+Math.abs(pchng)+'%'}else{perpchng='0.0%'}var html='
'+this.point.name+': '+perpchng+'
';return html},},plotOptions:{pie:{size:'100%',allowPointSelect:this.mode=='desktop'?true:false,cursor:'pointer',point:{events:{legendItemClick:function(e){e.preventDefault()},click:function(){if(this.mode=='desktop'){var e=!this.dataLabels||!this.dataLabels.enabled?true:false;this.update({dataLabels:{enabled:e}})}}}},dataLabels:{enabled:false,useHTML:true,formatter:function(){var pchng=this.point.pchng*1;var perpchng='';if(pchng>0){perpchng='+'+pchng+'%'}else if(pchng<0){perpchng='-'+Math.abs(pchng)+'%'}else{perpchng='0.0%'}return perpchng},style:{color:(Highcharts.theme&&Highcharts.theme.contrastTextColor)||'black'}},borderWidth:(self.data_length>1?2:0),}},legend:{enabled:false,},yAxis:{},series:[{type:'pie',name:'commerce',innerSize:'40%',colorByPoint:true,data:data,}],exporting:{enabled:false},}}}