折线图自定义提示显示系列和

楼主
我是社区第2268345位番薯,欢迎点我头像关注我哦~

折线图提示系列值和总和值,自定义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[i].color+"'>●</font>" + points[i].seriesName +':'+ points[i].value+'</br>';
        sum += points[i].value;
      }
  }
  return result+'●求和:'+sum;
}
分享扩散:

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

0回帖数 1关注人数 949浏览人数
最后回复于:2023-12-6 11:12

返回顶部 返回列表