Pie<T> class
- Inheritance
-
- Object
- ChartBodyRender<
T> - Pie
Constructors
-
Pie({required List<
T> data, required ChartPosition<T> position, List<Color> colors = colors10, List<Shader> ? shaders, double holeRadius = 0, TextStyle textStyle = const TextStyle(fontSize: 12, color: Colors.grey), TextStyle legendTextStyle = const TextStyle(fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold), Color lineColor = Colors.grey, double? spaceWidth, double valueTextOffset = 0, PieValueFormatter? valueFormatter, PieValueFormatter? legendFormatter, TextStyle? centerTextStyle, RotateDirection direction = RotateDirection.forward, bool guideLine = false, bool showValue = false, bool enableTap = true, double startAngle = 0})
Properties
- centerTextStyle → TextStyle?
-
中间文案样式 为空则不显示
final
- chartState ↔ ChartLayoutState
-
图表的布局状态
getter/setter pairinherited
-
colors
→ List<
Color> -
颜色
final
- controller ↔ ChartController
-
getter/setter pairinherited
-
data
→ List<
T> -
数据源
finalinherited
- direction → RotateDirection
-
扇形的方向
final
- enableTap → bool
-
是否能点击
final
- guideLine → bool
-
是否显示引导线
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- holeRadius → double
-
内圆半径
final
- index ↔ int
-
在图表中的位置
getter/setter pairinherited
- isInit ↔ bool
-
getter/setter pairinherited
- legendFormatter → PieValueFormatter?
-
图例文案格式化 不要使用过于耗时的方法
final
- legendTextStyle → TextStyle
-
图例样式
final
- lineColor → Color
-
引导线颜色
final
-
position
→ ChartPosition<
T> -
不要使用过于耗时的方法
数据在坐标系的位置,每个坐标系下取值逻辑不一样,在line和bar下是相对于每格的值,比如xAxis的interval为1,你的数据放在1列和2列中间,那么position就是0.5,在pie下是比例
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shaders
→ List<
Shader> ? -
优先级高于colors
final
- showValue → bool
-
是否在图中显示value
final
- spaceWidth → double?
-
百分比
final
- startAngle → double
-
开始弧度,可以调整起始位置
final
- textStyle → TextStyle
-
值文字样式
final
- valueFormatter → PieValueFormatter?
-
值文案格式化 不要使用过于耗时的方法
final
- valueTextOffset → double
-
值的位置偏移
final
- yAxisPosition → int
-
跟哪个y轴关联
finalinherited
Methods
-
draw(
Canvas canvas, ChartsState state) → void -
drawPie(
Canvas canvas, Path path, Paint paint) → void - 可以重写,依靠path和paint修改成特殊的样式
-
getLastData(
bool need) → List< ChartItemLayoutState> ? -
inherited
-
init(
ChartsState state) → void - 初始化 耗时的方法都可以放到这里
-
lerpList(
List< num> ? a, List<num> ? b, double t) → List<num> ? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited