折线图自定义提示显示系列和
折线图提示系列值和总和值,自定义js代码
function sumOfPoints() {
const point = this;
const points = this.points;
const len = points.length;
let sum = 0;
var result = '';
for (let i = 0; i < len; i++) {
if (point.isVisible()) {
result += "<font color='"+points.color+"'>●</font>" + points.seriesName +':'+ points.value+'</br>';
sum += points.value;
}
}
return result+'●求和:'+sum;
}