https://zhidao.baidu.com/question/812874976053952572.html
params为数组,附带该图例颜色,即圆点,下面例子为修改值加上百分号
formatter: function (params){
debugger;
return params[0].name + '<br/>'
+ '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[0].color + '"></span>' + params[0].seriesName + ' : ' + params[0].value + '%<br/>'
+ '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[1].color + '"></span>' + params[1].seriesName + ' : ' + (params[1].value) + '%<br/>'
+ '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[2].color + '"></span>' + params[2].seriesName + ' : ' + (params[2].value) + '%';
}
参考网址:https://segmentfault.com/q/1010000006988573
或者
"tooltip": {
"trigger": "axis",
"formatter": function(params) {
debugger;
var res = params[0].name;
for (var i = 0, l = params.length; i < l; i++) {
if (params[i].value != undefined && params[i].value != "-") {
res += '<br/><f + params[i].color + '" size="4">●</font>' + params[i].seriesName + ' : ' + params[i].value + "%"
} else {
res += '<br/><f size="4">●</font>面包 :- '
}
}
return res
}
},
参考网址:http://gallery.echartsjs.com/editor.html?c=xByk1W7-4x