echarts自定义提示框悬浮文字

echarts自定义提示框悬浮文字_第1张图片

  tooltip: {
        trigger: 'axis',
        axisPointer: {
          type: 'cross'
        },
        formatter: function(list) {
          var msg = list[0].name + "
"; for (let i in list) { if (list[i].componentIndex == "0") { msg += list[i].marker+ "配额盈缺量    " + (list[i].data) + "
"; } if (list[i].componentIndex == "1") { msg += list[i].marker+ "配额盈缺率    " + (list[i].data) + "%
"; } } return msg; } },

或者用list[i].componentSubType == "line"来判断

你可能感兴趣的:(echarts)