直接上代码吧,简单粗暴点:
tooltip: {
shared: true,
valueSuffix: '分',
formatter: function () {
let s = "";
$.each(this.points, function (i, v) {
s += '<span style="font-weight:bold;color:#7a85a2;display: block;">类型:'+v.point.paperType+' 成绩:'+v.point.y+'分</span> ';
});
return s;
},
useHTML: true
},
还有一点要注意,y轴数据必须要是数字类型:
let s = {
id: data[i][j].id,
y: Number(data[i][j].score,
CreateTimeStr: Login_common.formatDate(data[i][j].createTime).substring(0,10),
paperType: data[i][j].paperType
};