美文网首页
ECharts-漏斗图-添加标识

ECharts-漏斗图-添加标识

作者: 我是七月 | 来源:发表于2023-01-06 18:23 被阅读0次

ECharts-漏斗图-添加右边标识

ECharts-漏斗图
 let option = {
        legend: {
          data: ['注册用户量', '一键申请点击量', '电站量', '受理通过电站量'],
          x: 'left', //可设定图例在左、右、居中
          y: 'top', //可设定图例在上、下、居中
          padding: [0, 0, 0, 0],   //可设定图例[距上方距离,距右方距离,距下方距离,距左方距离]
        },
        color: ['#9cbbfb', '#7da5fc', '#5b90fa', '#4077ec', '#2b67db'],
        series: [
          {
            type: 'funnel',
            left: '5%',
            width: '60%',
            color: ['#de6a6e', '#f2ca6b', '#5a6fca', '#9eca7f'],
            label: {
              formatter: '',
              show: false
            },
            labelLine: {
              show: false
            },
            itemStyle: {
            },
            maxSize: '60%',
            top: 40,
            bottom: 30,
            sort: 'descending',
            data: [
              { value: 69, name: '注册用户量' },
              { value: 50, name: '一键申请点击量' },
              { value: 30, name: '电站量' },
              { value: 20, name: '受理通过电站量' },
            ]
          },
          {
            type: 'funnel',
            left: '-5%',
            width: '80%',
            maxSize: '0%',
            top: 40,
            bottom: 30,
            sort: 'descending',
            label: {
              show: true,
              lineHeight: 18,
              textBorderColor: 'transparent',
              formatter: function (params) {
                return (
                  '{f|' +
                  params.name +
                  '}' +
                  '\n' +
                  '(' +
                  params.data.percentage +
                  '%)'
                );
              },
              rich: {
                f: {
                  color: '#999999'//字体颜色
                }
              }
            },
            itemStyle: {
              opacity: 1,
              borderColor: 'transparent'
            },
            labelLine: {
              length: 150//线的长度
            },
             data: [
              { value: 0, name: '注册用户量', percentage: 88.77 },
              { value: 0, name: '一键申请点击量', percentage: 44.3 },
              { value: 0, name: '电站量', percentage: 22 },
              { value: 0, name: '受理通过电站量', percentage: 10 },
            ]
          }
        ]
      };

参考地址:https://blog.csdn.net/qq_27841373/article/details/125395722

相关文章

网友评论

      本文标题:ECharts-漏斗图-添加标识

      本文链接:https://www.haomeiwen.com/subject/hsejcdtx.html