}
var rowTr = listAndList.indicatorData[i];
rowTr.splice(0, 0, listAndList.colKeys[i]);
excellData.push(rowTr);
}
ExcellentExport.excelByData($("." + listAndList.indicatorName)[0], excellData, 'Sheet', 'download' + new Date().getTime() + '.xls');
return ev.stopPropagation();
}
},
watch : {
indicator : function (newValue) {
}
},
mounted : function () {
// this.item= this.listToRowObject(this.indicator);
},
beforeMount : function(){
this.item= this.listToRowObject(this.indicator);
this.mapOption = this.listToRowMap(this.indicator);
}
})
panelsVueArr.push(vueObj);
}
}
//格式化Y轴数字显示
var yAxisFormatter = function(value, index) {
var text = value;
if (!isNaN(value)) {
if (value > 10000) {
// 千分位 + 万
text = toThousands((value / 10000).toFixed(1)) + $.i18n.get('chart.wan');
}
}
if (value.formatter) {
text = value.formatter.replace("{value}", text);
}
return text;
}
//格式化tooltip
var tooltipFormatter = function (params,ticket,callback) {
console.log(params);
var color = params.color;
var html = '<span style="display:inline-block;margin-right:5px;' + 'border-radius:10px;width:9px;height:9px;background-color:'
+ color + '">行:'+params.seriesName +'</span>';
html+='<span style="display:inline-block;margin-right:5px;' + 'border-radius:10px;width:9px;height:9px;background-color:'
+ color + '">列:'+params.name +'</span>';
var showValue = params.value;
if (typeof (showValue) == "undefined") {
showValue = "NoData";
} else {
// 图悬浮框 千分位+万 +单位
if (!isNaN(showValue)) {
if (showValue > 10000||showValue<-10000) {
showValue = toThousands((showValue / 10000).toFixed(1)) + $.i18n.get('chart.wan');
}else{
showValue=parseFloat(showValue)*100;
showValue = showValue.toFixed(1) + unitHandle();
}
}
}
html+='<span style="display:inline-block;margin-right:5px;' + 'border-radius:10px;width:9px;height:9px;background-color:'
+ color + '">值:'+showValue +'</span>';
console.log(html);
return html;
}
// 数字格式处理 1,000,000
function toThousands(num) {
if (typeof (num) == 'undefined') {
num = ""
}
num = num + '', result = '';
if (num.indexOf('%') > -1) {
return num;
}
var s = "";
if (num.indexOf('.') > -1) {
s = num.substring(num.indexOf('.'), num.length);
num = num.substring(0, num.indexOf('.'));
}
var n = false;
if (num.indexOf('-') > -1) {
num = num.substring(1);
n = true;
}
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);










