CsPieChart<T extends CsPieChartDatum> class

Cloudscape's pie chart: parts of a whole as pie or donut segments with labels, a legend, a segment filter and a detail popover.

Cloudscape reference: https://cloudscape.design/components/pie-chart/

CsPieChart<CsPieChartDatum>(
  data: const [
    CsPieChartDatum(title: 'Running', value: 60),
    CsPieChartDatum(title: 'Stopped', value: 25),
    CsPieChartDatum(title: 'Terminated', value: 15),
  ],
  variant: CsPieChartVariant.donut,
  innerMetricValue: '100',
  innerMetricDescription: 'instances',
  ariaLabel: 'Instance states',
)

Hovering a segment (or tapping it) highlights it and opens a popover with its value and percentage; a click or tap pins the popover. With keyboard focus, Left and Right move between segments, Enter pins and Escape dismisses.

Inheritance

Constructors

CsPieChart({Key? key, required List<T> data, CsPieChartSize size = CsPieChartSize.medium, CsPieChartVariant variant = CsPieChartVariant.pie, CsPieChartDetailPopoverContent<T>? detailPopoverContent, Widget detailPopoverFooter(T segment)?, CsPieChartSegmentDescription<T>? segmentDescription, CsChartPopoverSize detailPopoverSize = CsChartPopoverSize.medium, bool hideLegend = false, bool hideTitles = false, bool hideDescriptions = false, bool hideFilter = false, String? innerMetricValue, String? innerMetricDescription, String? legendTitle, Widget? additionalFilters, T? highlightedSegment, ValueChanged<T?>? onHighlightChange, List<T>? visibleSegments, ValueChanged<List<T>>? onFilterChange, CsChartStatusType statusType = CsChartStatusType.finished, Widget? empty, Widget? noMatch, String? loadingText, String? errorText, String? recoveryText, VoidCallback? onRecoveryClick, String? ariaLabel, String? ariaDescription, CsPieChartI18nStrings i18nStrings = const CsPieChartI18nStrings(), bool fitHeight = false})
const

Properties

additionalFilters → Widget?
Extra filters next to the built-in filter.
final
ariaDescription → String?
A short summary of the chart, read before the generated segment list.
final
ariaLabel → String?
Accessible name of the chart; match the visible heading.
final
data → List<T>
Segments, in clockwise order from 12 o'clock.
final
detailPopoverContent → CsPieChartDetailPopoverContent<T>?
Popover rows for a segment. Defaults to its value and percentage.
final
detailPopoverFooter → Widget Function(T segment)?
Content under a divider at the bottom of the popover.
final
detailPopoverSize → CsChartPopoverSize
Maximum width of the popover.
final
empty → Widget?
Shown when data is empty or every value is zero.
final
errorText → String?
Defaults to "The data couldn't be fetched. Try again later.".
final
fitHeight → bool
Fill the parent's height. The parent must have a bounded height.
final
hashCode → int
The hash code for this object.
no setterinherited
hideDescriptions → bool
Hides the segment descriptions next to the chart.
final
hideFilter → bool
Hides the built-in segment filter.
final
hideLegend → bool
Hides the legend. Keep it unless labels already name every segment.
final
hideTitles → bool
Hides the segment titles next to the chart.
final
highlightedSegment → T?
Segment to highlight. The chart also highlights on hover and focus; a new value passed here replaces the current highlight.
final
i18nStrings → CsPieChartI18nStrings
final
innerMetricDescription → String?
Text under innerMetricValue, usually its unit. Not shown for small donuts.
final
innerMetricValue → String?
Large text in the middle of a donut.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
legendTitle → String?
Bold title above the legend.
final
loadingText → String?
Defaults to "Loading chart".
final
noMatch → Widget?
Shown when the filter hides every segment.
final
onFilterChange → ValueChanged<List<T>>?
Called with the new visible segments when the built-in filter changes.
final
onHighlightChange → ValueChanged<T?>?
Called when the user highlights a segment or clears the highlight.
final
onRecoveryClick → VoidCallback?
Called from the recovery link. Without it there is no link.
final
recoveryText → String?
Text of the recovery link. Defaults to "Retry".
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segmentDescription → CsPieChartSegmentDescription<T>?
Text under each segment's label (unless hideDescriptions).
final
size → CsPieChartSize
Outer radius: 50, 100 or 140px. With fitHeight, the minimum size.
final
statusType → CsChartStatusType
Loading state of the data.
final
variant → CsPieChartVariant
Pie, or donut with innerMetricValue and innerMetricDescription in the middle.
final
visibleSegments → List<T>?
Segments currently shown. Null lets the built-in filter manage it.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<CsPieChart<T>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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