var mfPieChart={init:function(type,order,top_n,days,callback){if(days==undefined){days="1"}var self=this;$.getJSON('/'+lang+'/data/chart/mfPieChart/type/'+type+'/order/'+order+'/top_n/'+top_n+'/days/'+days,function(_data){var data=self.decode(_data);$('#mfPieChartContainer').highcharts(self.getJSON(data),function(){if(callback!==undefined){callback(chart,data)}})})},decode:function(_data){return _data.mainData},getJSON:function(data){var self=this;return{chart:{plotBackgroundColor:null,plotBorderWidth:null,plotShadow:false,type:'pie',},title:{text:null},tooltip:{formatter:function(){console.log(this);return self.labels[lang].tooltip_1+'(%): '+this.percentage.toFixed(2)+'%
'+self.labels[lang].tooltip_1+'('+self.labels[lang].tooltip_2+'): '+(this.y/1000).toFixed(3)+''}},plotOptions:{pie:{size:'100%',allowPointSelect:true,cursor:'pointer',dataLabels:{enabled:true,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","#f9bfbe"],borderWidth:0,dataLabels:{enabled:false}}},legend:{enabled:true,layout:'vertical',align:'right',verticalAlign:'middle',labelFormatter:function(){return this.name},itemMarginBottom:15,},series:[{colorByPoint:true,data:data}],exporting:{enabled:false},}},labels:{tc:{tooltip_1:'成交金額',tooltip_2:'百萬港元',},sc:{tooltip_1:'成交金额',tooltip_2:'百万港元',},en:{tooltip_1:'Turnover',tooltip_2:'Million HKD',},},}