本文主要是介绍EChart 文字大小调整,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、EChart图中的文字调整(以饼图为例)
1.图中‘1’的文字大小调整在‘legend’对象下的‘textStyle’属性里
2.图中‘2’的文字大小调整在‘tooltip’对象下的‘textStyle’属性里
3.图中‘3’的文字大小调整在‘series’对象下的‘label’属性里
二、源码:
{"title": {"text": "","subtext": "","x": "center"},"tooltip": {"trigger": "item","formatter": "{a} <br\/>{b} : {c}%","textStyle": {"fontSize": 18}},"legend": {"orient": "vertical","left": "left","data": ["", "使用场景", "活动", "适用人群", "品牌", "款式", "物流", "价格", "功能", "服务", "质量"],"textStyle": {"fontSize": 18}},"toolbox": {"feature": {"dataView": {"show": true,"readOnly": false},"saveAsImage": {"show": true}}},"series": [{"name": "","type": "pie","radius": ["0%", "100%"],"data": [{"name": "使用场景","value": 0.23}, {"name": "活动","value": 0.44}, {"name": "适用人群","value": 0.83}, {"name": "品牌","value": 1.09}, {"name": "款式","value": 4.56}, {"name": "物流","value": 7.56}, {"name": "价格","value": 7.62}, {"name": "功能","value": 17.03}, {"name": "服务","value": 20.03}, {"name": "质量","value": 40.6}],"label": {"normal": {"show": true,"textStyle": {"fontSize": 18 }},"emphasis": {"show": true}},"lableLine": {"normal": {"show": true},"emphasis": {"show": true}}}]
}
这篇关于EChart 文字大小调整的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!