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
  }
}