PieChartData class

Represents data for a single slice of a pie chart.

Constructors

PieChartData.new({required double value, required String label, Color? color, VoidCallback? onTap})
Constructor for PieChartData.
const
PieChartData.fromJson(Map<String, dynamic> json)
Creates a PieChartData instance from a JSON map. Supports both simple and Plotly-compatible formats.
factory

Properties

color Color?
The color of the slice. It can be null, in which case a default color will be used.
final
hashCode int
The hash code for this object.
no setterinherited
label String
The label for the slice, which will be displayed in the chart.
final
onTap VoidCallback?
The action on tap for the slice.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value double
The value that represents the size of the slice.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the PieChartData to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

colorToHex(Color color) String
Helper method to convert Color to hex string
parseColor(dynamic colorValue) Color
Helper method to parse color from various formats