解决方法:在optionToContent事件返回的数据最外层添加css样式:“user-select: text”属性;
optionToContent: function(opt) {
var axisData = opt.xAxis[0].data;
var series = opt.series;
console.log(series)
var table = '<table border="1" class="table-bordered table-striped" style="user-select:text;width:100%;text-align:center"><tbody><tr>'
+ '<td>机型</td>'
+ '<td>' + $("#s2id_analysisParameter .select2-chosen").text().replace(/\s*/g,"") + '</td>'
// + '<td>' + series[1].name + '</td>'
+ '</tr>';
for (var i = 0, l = series[0].data.length; i < l; i++) {
table += '<tr>'
+ '<td>' + series[0].data[i][0] + '</td>'
+ '<td>' + series[0].data[i][1] + '</td>'
// + '<td>' + series[1].data[i] + '</td>'
+ '</tr>';
}
table += '</tbody></table>';
return table;
},
contentToOption: function(HTMLDomElement, opt){undefined
return opt;
},
}