PieChart 饼状图控件
控件名称
PieChart
中文名称
饼状图控件


控件优点
PieChart 是一个功能丰富的饼状图控件,支持点击偏移动画、百分比显示、图例显示等功能。适用于数据可视化、比例分析等场景。
主要特性
- 点击交互:支持点击扇区偏移动画
- 百分比显示:支持显示扇区百分比
- 图例显示:支持多种位置的图例显示
- 动画效果:支持扇区偏移动画
- 数据绑定:支持数据集合绑定
- 中心圆:支持在饼图中心显示同心圆和说明文本
重要参数说明
基本属性
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
Data |
List |
- | 饼图数据集合 |
ShowPercentage |
bool | true | 是否显示百分比 |
ShowLabels |
bool | true | 是否显示标签 |
LegendPosition |
LegendPosition | TopRight | 图例位置 |
图例位置(LegendPosition)
| 位置值 | 说明 |
|---|---|
None |
不显示图例 |
TopLeft |
顶部左对齐(横向排列) |
TopCenter |
顶部居中(横向排列) |
TopRight |
顶部右对齐(横向排列) |
BottomLeft |
底部左对齐(横向排列) |
BottomCenter |
底部居中(横向排列) |
BottomRight |
底部右对齐(横向排列) |
PieSlice 属性
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
Label |
string | "" | 扇区标签 |
Value |
double | 0 | 扇区数值 |
Color |
Color | Gray | 扇区颜色 |
IsExploded |
bool | false | 是否偏移 |
ExplodeOffset |
float | 15f | 偏移距离 |
外观属性
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
ChartSize |
int | 200 | 饼图大小 |
BorderWidth |
int | 2 | 边框宽度 |
BorderColor |
Color | White | 边框颜色 |
TextColor |
Color | Black | 文本颜色 |
Font |
Font | 微软雅黑 | 字体 |
中心圆属性
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
ShowCenterCircle |
bool | false | 是否显示中心圆 |
CenterCircleColor |
Color | White | 中心圆背景色 |
CenterCircleAlpha |
int | 204 | 中心圆背景透明度(0-255,默认204即80%) |
CenterCircleText |
string | "" | 中心圆文本内容(支持换行) |
CenterCircleRadiusRatio |
float | 0.33f | 中心圆半径比例(相对于饼图半径,0.1-0.5) |