xAxis: { axisLabel: { interval: 0, //x轴文字全部显示 formatter: function(params) { let newParamsName = '' const paramsNameNumber = params.length // 获取文数总长度 const provideNumber = 8 //控制每行的字段 const rowNumber = Math.ceil(paramsNameNumber / provideNumber) if (paramsNameNumber > provideNumber) { for (let p = 0; p < rowNumber; p++) { const start = p * provideNumber const end = start + provideNumber const tempStr = p === rowNumber - 1 ? params.substring(start, paramsNameNumber) : params.substring(start, end) + '\n' newParamsName += tempStr } } else { newParamsName = params } return newParamsName }, }, },