item.partyName = item.partyName.slice(0, 14) + '...'
四舍五入+替换
let str = Math.round(res.amountRatio * 100);
this.amountRatio = str.toString().replace('-', '');
获取数组中的最大值
let max2 = Math.max.apply(null, amountarr);
//处理图表数据
if (res.bankTypeStatistics.length > 0) {
let countarr = [];
let amountarr = [];
let bankTypearr = [];
res.bankTypeStatistics.map(item => {
amountarr.push(Math.round(item.amount));
countarr.push(item.count);
if (item.bankType.indexOf('制') != 1) {
item.bankType = item.bankType.replace('制', '');
}
bankTypearr.push(item.bankType);
})
let max1 = Math.max.apply(null, countarr) + 1;
let max2 = Math.max.apply(null, amountarr);
this.punishOrder.yAxis[0].data = bankTypearr;
this.punishOrder.series[0].data = countarr;
this.punishOrder.series[1].data = amountarr;
this.punishOrder.xAxis[0].max = max1 + (max1 / 2);
this.punishOrder.xAxis[1].max = max2 + (max2 / 2);
this.drawPunish(this.punishOrder);
}