需求

ehcarts 柱状图x轴坐标值改为图片

方法:

1参考网站:http://www.echartsjs.com/gallery/editor.html?c=bar-rich-text&theme=dark

代码:x坐标值设置,尤其是

ehcarts 柱状图x轴坐标值改为图片

图片路径提前设置好

ehcarts 柱状图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
                    }
                }
            }
        }

    }

小插曲,我同一页面有做换环形图和柱状图,所以文件有冲突图片一直报错。

相关文章:

  • 2021-11-18
  • 2021-11-14
  • 2021-11-26
  • 2021-12-01
  • 2022-12-23
  • 2021-08-12
  • 2021-04-01
猜你喜欢
  • 2021-09-18
  • 2021-04-15
  • 2022-12-23
  • 2021-09-04
  • 2021-08-25
  • 2021-07-08
  • 2022-12-23
相关资源
相似解决方案