(本文档仅供参考)
问题1:
希望在自助仪表盘中实现柱图颜色设置,请问如何在自主仪表盘中实现柱图颜色类似于电子表格做柱图的颜色设置:https://history.wiki.smartbi.com.cn/pages/viewpage.action?pageId=35750506
解决方案
自助仪表盘的柱图是在series[{}]属性中的data[{}]进行设置的,如果有多少条数据就设置 "itemStyle": {"normal": {"color": "#FFAF00"}} 多少次,具有可参考如下设置:
{ "series": [ { "data": [ { "itemStyle": { "normal": { "color": "#FFAF00" } } }, { "itemStyle": { "normal": { "color": "#004151" } } }, { "itemStyle": { "normal": { "color": "#00B7BF" } } }, { "itemStyle": { "normal": { "color": "#F9334C" } } }, { "itemStyle": { "normal": { "color": "#FFAF00" } } }, { "itemStyle": { "normal": { "color": "#004151" } } }, { "itemStyle": { "normal": { "color": "#00B7BF" } } }, { "itemStyle": { "normal": { "color": "#F9334C" } } } ] } ] }
最终效果:
问题2:
需要实现柱图设置多个柱子中的颜色,柱图是由并列轴+一个指标构成,如图:
解决方案
1、可设置自定义图形主题实现
2、或者用扩展属性实现,示例:
1 |
|
最终预览效果如下: