@shaf #43 @niutou #45 @exit #49 @你看起来真好笑 #51 bug已修正,最终替换代码 parseMonitorInfo(monitorInfo) { let tSeries = []; let tLegendData = []; var lcolors = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc']; for (let i = 0; i < monitorInfo.result.length; i++) { var lcolor = lcolors[i % lcolors.length]; var rgbaColorMarker = 'rgba(' + parseInt(lcolor.slice(1, 3), 16) + ',' + parseInt(lcolor.slice(3, 5), 16) + ',' + parseInt(lcolor.slice(5, 7), 16) + ',0.5)'; var rgbaColorBar = 'rgba(' + parseInt(lcolor.slice(1, 3), 16) + ',' + parseInt(lcolor.slice(3, 5), 16) + ',' + parseInt(lcolor.slice(5, 7), 16) + ',0.35)'; let loss = 0; let data = []; let datal = []; for (let j = 0; j < monitorInfo.result[i].created_at.length; j++) { avgDelay = Math.round(monitorInfo.result[i].avg_delay[j]); if (avgDelay > 0 && avgDelay < MaxTCPPingValue) { data.push([monitorInfo.result[i].created_at[j], avgDelay]); } else { loss += 1; datal.push({ xAxis: monitorInfo.result[i].created_at[j], label: { show: false }, emphasis: { disabled: true }, lineStyle: { type: "solid", color: rgbaColorBar } }); } } lossRate = ((loss / monitorInfo.result[i].created_at.length) * 100).toFixed(1); if (lossRate > 99) { datal = []; } legendName = monitorInfo.result[i].monitor_name +" "+ lossRate + "%"; tLegendData.push(legendName); tSeries.push({ name: legendName, type: 'line', smooth: true, symbol: 'none', data: data, markLine: { symbol: "none", symbolSize :0, data: datal }, markPoint: { data: [ { type: 'max', symbol: 'pin', name: 'Max', itemStyle: { color: rgbaColorMarker }, symbolSize: 30, label: { fontSize: 8 } }, { type: 'min', symbol: 'pin', name: 'Min', itemStyle: { color: rgbaColorMarker }, symbolSize: 30, label: { fontSize: 8, offset: [0, 7.5] }, symbolRotate: 180 } ] } }); } this.option.title.text = monitorInfo.result[0].server_name; this.option.series = tSeries; this.option.legend.data = tLegendData; this.myChart.clear(); this.myChart.setOption(this.option); },
个别有bug,全挤在一起了

@exit #49 是的,不过这样丢包断流啥的smoke显示就没有了
@你看起来真好笑 #51 我回去再调试一下吧
@xy #52 已经很不错了,感谢楼主
@shaf #43 @niutou #45 @exit #49 @你看起来真好笑 #51 bug已修正,最终替换代码
@xy #55
赞,我试试
@xy #55 感谢,没问题了
@xy #55 感谢楼主,已测试OK:

另:我用原版的时候,这台机在Ping值不高的情况下只显示到400,现在显示的有点高(好像是最高Ping值的2倍显示)
@exit #58 我记得我之前把这个问题修正了呀
给力的楼主
