(本文档仅供参考)
...
问题
堆积柱图数据项标签设置居上时部分标签被覆盖,悬停的时候才会出现
...
解决方案
此问题为由第三方作图工具echarts的处理逻辑导致,可不设置数据项标签并使用以下扩展属性进行规避。
代码块 |
---|
{ |
...
"series": [{ |
...
"name": "销售额", |
...
"type": "bar", |
...
"stack": "总量", |
...
"barMaxWidth": 35, |
...
"barGap": "10%", |
...
"itemStyle": { |
...
"normal": { |
...
"color": "rgba(255,144,128,1)", |
...
"label": { |
...
"show": true, |
...
"textStyle": { |
...
"color": "#fff" |
...
}, |
...
"position": "innerTop" //设置内部居上 |
...
} |
...
} |
...
} |
...
}, { |
...
"name": "销售量", |
...
"type": "bar", |
...
"stack": "总量", |
...
"itemStyle": { |
...
"normal": { |
...
"color": "rgba(0,191,183,1)", |
...
"barBorderRadius": 0, |
...
"label": { |
...
"show": true, |
...
"position": "top" |
...
} |
...
} |
...
} |
...
}] |
...
} |
效果:
参考:https://www.makeapie.com/editor.html?c=xeAx1KwHM-
...