funnelOption.js 1.33 KB
const funnelOption = {
  tooltip: {
    trigger: 'item',
    formatter: function(params, ticket, callback) {
      return `${params.data.tooltipName}:${params.data.tooltipValue}`
    }
  },
  series: [
    {
      name: '漏斗图',
      type: 'funnel',
      left: '0',
      top: 50,
      // x2: 80,
      bottom: 0,
      width: '140px',
      height: '120px',
      // height: {totalHeight} - y - y2,
      min: 0,
      max: 60,
      minSize: '0%',
      maxSize: '100%',
      sort: 'descending',
      gap: 2,
      label: {
        show: true,
        position: 'right'
      },
      // silent: true,
      labelLine: {
        length: 10,
        lineStyle: {
          width: 1,
          type: 'solid'
        }
      },
      itemStyle: {
        borderColor: '#fff',
        borderWidth: 1
      },
      emphasis: {
        label: {
          fontSize: 20
        }
      },
      data: [
        { value: 60, name: '流量总量', tooltipName: '流量总量', tooltipValue: '100', itemStyle: { color: 'rgba(9,71,198,1)' } },
        { value: 40, name: '已到店', tooltipName: '总到店数', tooltipValue: '100', itemStyle: { color: 'rgba(43,154,255,1)' } },
        { value: 20, name: '已转化', tooltipName: '总升级数', tooltipValue: '100', itemStyle: { color: 'rgba(255,170,0,1)' } }

      ]
    }
  ]
}

export default funnelOption