需要在formatter中自行拼接字符串。
<span style="display: inline-block; margin-right: 5px; border-radius: 10px; width: 9px; height: 9px; background-color: red"></span>
tooltip: {
trigger: "axis",
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
},
formatter:
"处方点评量: " +
1111 +
"<br /><span style='display: inline-block; margin-right: 5px; border-radius: 10px; width: 9px; height: 9px; background-color: #5470c6'></span>{a0}处方: {c0}(占比:%)<br /><span style='display: inline-block; margin-right: 5px; border-radius: 10px; width: 9px; height: 9px; background-color: #91cc75'></span>{a1}处方: {c1}(占比:%)",
},