echart a series of label formatter and add callback function to use Picture Style

I want to add pictures triangle
in the series-> label -> formatter is set to add a picture, with the rich in order to achieve

{
        name: '峰值',
        type: 'bar',
        stack: 'b',
        yAxisIndex: 0,
        barGap: '-100%',
        barWidth: 15,
        data: [100, 200],
        label: {
          normal: {
            show: true,
            position: 'right',
            distance: 10,
            rich: {
              img1: {
                backgroundColor: {
                  image: maxNum
                }
              }
            },
            formatter: function (param) {
              var res = '';
              res += param.value
                + '\n {img1|}'
              return res;
            },
            textStyle: {
              color: '#ccc',
              fontSize: '16'
            }
          }
        },
        itemStyle: {
          normal: {
            color: '#fff'
          }
        },
        z: 1
      },

Pictures path, you can also write directly in the image: back
Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description

not only the rich can add a picture, if you want to modify the style can be added in the rich,

Published 47 original articles · won praise 42 · Views 140,000 +

Guess you like

Origin blog.csdn.net/zm_miner/article/details/102689266