echarts自定义提示框数据

  tooltip: {
    trigger: "axis",
    axisPointer: {
    // 坐标轴指示器,坐标轴触发有效
    type: "line" // 默认为直线,可选为:'line' | 'shadow'
    },
    formatter: function(params) {
    var texts = "";
    for (var i = 0; i < params.length; i++) {
      if (i == 0) {
        texts += params[i].name + "
";
        }
    texts +=
    params[i].seriesName + ": " + params[i].value + "
";
    }
  return texts;
  }
}

转载于:https://www.cnblogs.com/wgy0528/p/9443908.html

你可能感兴趣的:(echarts自定义提示框数据)