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 + "<br>"; } texts += params[i].seriesName + ": " + params[i].value + "<br>"; } return texts; } }