PieChartData constructor
PieChartData({
- List<
PieChartSectionData> ? sections, - double? centerSpaceRadius,
- Color? centerSpaceColor,
- double? sectionsSpace,
- double? startDegreeOffset,
- PieTouchData? pieTouchData,
- FlBorderData? borderData,
PieChart draws some sections
in a circle,
and applies free space with radius centerSpaceRadius
,
and color centerSpaceColor
in the center of the circle,
if you don't want it, set centerSpaceRadius
to zero.
It draws sections
from zero degree (right side of the circle) clockwise,
you can change the starting point, by changing startDegreeOffset
(in degrees).
You can define a gap between sections
by setting sectionsSpace
.
You can modify pieTouchData
to customize touch behaviors and responses.
Implementation
PieChartData({
List<PieChartSectionData>? sections,
double? centerSpaceRadius,
Color? centerSpaceColor,
double? sectionsSpace,
double? startDegreeOffset,
PieTouchData? pieTouchData,
FlBorderData? borderData,
}) : sections = sections?.where((element) => element.value != 0).toList() ??
const [],
centerSpaceRadius = centerSpaceRadius ?? double.infinity,
centerSpaceColor = centerSpaceColor ?? Colors.transparent,
sectionsSpace = sectionsSpace ?? 2,
startDegreeOffset = startDegreeOffset ?? 0,
pieTouchData = pieTouchData ?? PieTouchData(),
super(
borderData: borderData ?? FlBorderData(show: false),
touchData: pieTouchData ?? PieTouchData(),
);