legend{ formatter: function(name) { var data = option.series[0].data; var tarValue = '' for (var i = 0; i < data.length; i++) { if (data[i].name == name) { tarValue = data[i].value; } } return "{name|" +name +"} {value|"+tarValue+"}"; }, textStyle:{ fontSize: 14, color: '#343D54', rich: { value: { color: '#1252AF', fontSize: 14, }, } }, }