Skip to content

饼图

image

介绍

饼图是一种常见的数据可视化图表,主要用于展示各类别占总量的比例关系。通过每个扇形的大小,可以直观地看出各类别在总量中的占比。饼图适用于对比少量类别的占比数据,例如市场份额、人口结构等。

API

Props

参数名描述类型默认值
status默认状态,支持变量绑定'default' | 'hide''default'
showRoseType南丁格尔图,是否开启南丁格尔图样式Booleanfalse
roseType模式,南丁格尔图模式'radius' | 'area''area'
inRadius内径,饼图内径string'0%'
outRadius外径,饼图外径string'75%'
data数据源,支持变量绑定Array<Record<string, any>>-
dimensionField维度,类目的数据字段编码string'indicator'
dataField数值,数值系列的数据字段编码string'value'
width宽,图表画布宽度string'500px'
height高,图表画布高度string'300px'
centerLeft圆心左边距,圆心距离画布左侧边距string'50%'
centerTop圆心上边距,圆心距离画布上侧边距string'50%'
customChart配置项参数,code
标题标题,图表标题配置标题-
饼图饼图,饼图配置饼图-
图例图例,图表图例配置图例-
提示框提示框,图表提示框配置提示框-
key唯一标识,组件唯一标识string组件 key 值

Props 标题

参数名描述类型默认值
showTitle显示标题,图表标题是否显示booleanfalse
title主标题,图表主标题string'主标题'
subTitle副标题,图表副标题string'副标题'
customTtile自定义参数(title),code

Props 饼图

参数名描述类型默认值
clockwise顺时针排布,饼图数据项排布方向booleantrue
startangle起始角度,排布起始角度string90
percentaccuracy百分比数值精度,数值精度string2
showLabel显示标签,图表是否显示标签booleanfalse
labelFontSize字号,标签字号string12
labelColor颜色,标签文字颜色string-
customPie自定义参数(pie),code

Props 图例

参数名描述类型默认值
showLegend显示图例,图表图例是否显示booleantrue
legendPosition图例位置,图例显示位置'auto' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right''auto'
legendOrient布局方向,图例排列方向'horizontal' | 'vertical''horizontal'
legendWidth宽,图例区域宽度string'auto'
legendHeight高,图例区域高度string'auto'
legendScroll支持滚动,图例超出宽高后是否支持滚动booleanfalse
customLegend自定义参数(legend),code

Props 提示框

参数名描述类型默认值
showTooltip显示提示框,图表提示框是否显示booleantrue
tooltipTrigger触发类型,提示框触发类型'item' | 'axis''item'
tooltipBackgroundColor背景颜色,提示框背景颜色string'rgba(50,50,50,0.7)'
tooltipBorderColor边框颜色,提示框边框颜色string'#333333'
tooltipColor文字颜色,提示框文字颜色string'#FFFFFF'
tooltipFontSize字号,提示框文字字号string14
customTooltip自定义参数(tooltip),code