(本文档仅供参考)
...
问题一
在电子表格中的echarts图形使用横条图,然后想显示文字在上方,同时Y轴的文字不显示,
如下效果图:
...
解决方案
可以使用扩展属性实现,如下:
代码块 | ||
---|---|---|
| ||
{
//此部分控制Y轴不显示文字
"yAxis": {
"type": "category",
"boundaryGap": true,
"axisTick": {
"show": false
},
"axisLabel": {
"show": true,
"textStyle": {
"color": "none",
},
},
},
"series": [{
"barWidth": 15, //柱子宽度
"barGap": 1, //柱子之间间距
"itemStyle": {
"normal": {
//这部分让指标提示显示在上方
"label": {
"formatter": "{b}{c}千万元",
"show": true,
"position": "top",
}
}
}
}]
}
|
问题二
在自助仪表盘中的echarts图形使用横条图,然后想显示文字在上方,同时Y轴的文字不显示,如下图的效果:
解决方案
1,先打开自定义扩展属性,然后添加英文逗号,再把下面的扩展属性添加进去
可以使用扩展属性实现,如下:
代码块 | ||
---|---|---|
| ||
"series": [ { "barWidth": 10, "barGap": 1, "itemStyle": { "normal": { "label": { "formatter": "{b}{c}千万元", "show": true, "position": "top" } } } } ] |
2,对组件设置中的坐标轴设置如下: