Skip to content

FunnelChart 漏斗图

基于 ECharts 封装的漏斗图组件,适用于展示转化率等数据。

基础用法

vue
<script setup>
import { funnelChart } from '@twi1i9ht/visual-lib'

const data = [
  { value: 100, name: '展现' },
  { value: 80, name: '点击' },
  { value: 60, name: '访问' },
  { value: 40, name: '咨询' },
  { value: 20, name: '订单' },
]
</script>

<template>
  <funnelChart :data="data" title="转化漏斗" />
</template>

Props

属性类型默认值说明
dataArray<{ value: number, name: string }>数据数组
titlestring图表标题
sort'ascending' | 'descending' | 'none''descending'排序方式
orient'vertical' | 'horizontal''vertical'方向
gapnumber2间隔
showLabelbooleantrue是否显示标签
labelPosition'left' | 'right' | 'inside''right'标签位置
optionEChartsOption高级配置

Released under the MIT License.