Skip to content

漏斗图Funnel

一、效果总览

二、描述

使用场景

  1. 通常用于表达转化率的场景
  2. 需要定制化漏斗图的场景

三、构造函数及参数说明

typescript
OmniFunnelChart({
  @Require config: OmniFunnelChartConfig
})

interface OmniFunnelChartConfig {
    layerHeight: number
    layerCount: number
    defaultLayerColor: Color[]
    layerTextColor: Color
    markerTextColor: Color
    maxLayerWidth: number
    minLayerWidth: number
    axisBackground?: Color | undefined
    layerTitles: string[]
    markerTitles: string[]
    layerMargin?: number
    shape?: OmniFunnelShape
    layerTextFont?: string
    markerTextFont?: string
}

一级参数

参数名参数类型描述是否必填默认值
configOmniFunnelChartConfig漏斗图配置入参

二级参数

参数名参数类型描述是否必填默认值
layerHeightnumber漏斗每层的高度40
layerCountnumber漏斗层数
defaultLayerColorColor[]漏斗每层颜色
layerTextColorColor漏斗文本颜色0xffffffff
markerTextColorColor漏斗标记物文本颜色0xff000000
maxLayerWidthnumber漏斗最大宽度
minLayerWidthnumber漏斗最小宽度
axisBackgroundColor坐标轴背景颜色0xFFEEF0FF
layerTitlesstring[]漏斗每层文本layer
markerTitlesstring[]漏斗标记物每层文本marker
layerMarginnumber漏斗物每层间距0
shapeOmniFunnelShape漏斗形状OmniFunnelShape.Both
layerTextFontstring漏斗每层文本字号'normal normal 50px sans-serif'
markerTextFontstring漏斗每层标记物文本字号'normal normal 50px sans-serif'

四、代码演示

默认效果

typescript
{
  config: {
    shape: OmniFunnelShape.Both
  }
}

左漏斗

typescript
{
  config: {
    shape: OmniFunnelShape.Left
  }
}

右漏斗

typescript
{
  config: {
    shape: OmniFunnelShape.Right
  }
}