echarts自定义tooltip显示内容

     tooltip: {
          trigger: "axis",

          formatter: function (params) {
            var result = params[0].name;
            params.forEach(function (item) {
              result += "<br/>";
              result +=
                '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' +
                item.color +
                '"></span>';
              result += item.seriesName + ":";
              result += isNaN(item.value) ? 0 : item.value;
            });
            return result;
          },
        },

修改前:
echarts自定义tooltip显示内容

修改后:
echarts自定义tooltip显示内容

相关文章:

  • 2021-09-05
  • 2022-01-29
  • 2022-12-23
  • 2021-11-06
  • 2021-06-14
猜你喜欢
  • 2021-06-09
  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-06-18
相关资源
相似解决方案