ehcarts 柱状图x轴坐标值改为图片
需求
方法:
1参考网站:http://www.echartsjs.com/gallery/editor.html?c=bar-rich-text&theme=dark
代码:x坐标值设置,尤其是
图片路径提前设置好
xAxis: {
type: 'category',
show: true,
data: ['Line', 'Bar', 'Scatter', 'Ka', 'Pie', 'Radar', 'Chord', 'Force'],
axisLabel: {
formatter: function (value) {
return '{'+ value + '| }';
},
rich: {
Line: {
width: 25,
height:25,
align: 'top',
backgroundColor: {
image: schlogoIcon.schlogo1
}
},
Bar: {
width: 25,
height:25,
align: 'top',
backgroundColor: {
image: schlogoIcon.schlogo2
}
}
}
}
}
小插曲,我同一页面有做换环形图和柱状图,所以文件有冲突图片一直报错。