echarts 的富文本标签在3.7版本就发布了,那应该也就可以正常使用,但是在我本地系统中(echarts版本为3.7.2,后面升级到3.8.4),均无法正常展示富文本标签;而把代码copy到官网实例中却可以正常展示,如截图。从官网实例中down下代码查看,引用的是echarts 4.0以后的版本。
所以想询问下富文本标签使用的实际版本要求是多少,还是说我的代码中有错漏的地方,请大神帮忙看下!
配置项如下
option = {
"title": {
"text": "四象限",
"subtext": ""
},
"grid": {
"left": "3%",
"right": "3%",
"bottom": "3%",
"containLabel": true
},
"tooltip": {
"trigger": "item"
},
"brush": {},
"legend": {
"data": ["地区"],
"left": "center"
},
"xAxis": [{
"type": "value",
"min": -50,
"max": 50,
"axisLabel": {
"formatter": "{value} %"
},
"splitLine": {
"show": false
},
"axisTick": false,
"axisLine": {
"show": false
},
"splitNumber": 8
}],
"yAxis": [{
"type": "value",
"min": 0,
"max": 200,
"axisLabel": {
"formatter": "{value}%"
},
"splitLine": {
"show": false
},
"axisTick": false,
"splitNumber": 10
}],
"series": [{
"type": "scatter",
"label": {
"show": true,
"formatter": "{a|收入达标,折让率无空间}\n(低质高折让收入替换)",
"backgroundColor": "#eee",
"borderColor": "rgb(199,86,83)",
"borderWidth": 1,
"borderRadius": 10,
"padding": 10,
"color": "#000",
"fontSize": 14,
"shadowBlur": 3,
"shadowColor": "#888",
"lineHeight": 30,
"rich": {
"a": {
"fontSize": 15,
"color": "rgb(199,86,83)"
}
}
},
"data": [
[40, 180],
[-40, 180],
[-40, 20],
[40, 20]
]
}]
};