Meter chart
PaymentMeterChart shows a snapshot of category amounts without a computed headline or percentages.



PaymentMeterChart( segments: [ for (final p in points) if (p.value != null) MeterSegment(label: p.label, value: p.value!, status: p.status), ], );Variants
Section titled “Variants”Variants: money, percentage, number; up to five categories.
States and variants
Section titled “States and variants”Settled marks are solid, pending marks are outlined or dashed, and unknown marks are hatched or dotted. A null point is a gap, never zero. Use one currency per chart. Bar and meter amounts must be non-negative; line charts accept negative amounts.
Series, axes and units
Section titled “Series, axes and units”Use named series with identical period labels and ordering. Line and bar charts accept up to three series; sparklines accept two. Series use an accent ramp and distinct dash patterns, never status tones. All series share a scale. showLegend controls the legend for multiple series.
axis and grid each take x, y, both or none. Colors come from named PaymentChartSeries. unit is money, percent or number.
Use a line for direction, bars for period comparisons, a meter for category proportions and a sparkline beside a KPI. Percent and number units read measure; money reads value. A measure of 45 means 45 percent. Missing readings remain gaps.
Sparklines can opt into inspectable, giving a 48 dp target. Press and hold to read a value. Unlike line and bar charts, a sparkline has no value label at rest: it sits beside a KPI that already states the amount. Meter onSegmentPressed activates full-width legend rows; the painted bar takes no taps.
Breaking: MeterSegment.color is removed. Use the semantic category ramp. MeterSegment.value is optional; supply measure for numeric units. Point value and chart points are optional when using measures or series.
PaymentChartSeries
class PaymentChartSeries · lib/src/charts/chart_models.dart
Named points sharing the same periods with the other series.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Legend and spoken name. |
points:required | List<ChartPoint> | — | One point per period. |
PaymentChartAxis
enum PaymentChartAxis · lib/src/charts/chart_models.dart
Axes to label or grid.
| Value | Description |
|---|---|
x | Horizontal axis. |
y | Vertical axis. |
both | Both axes. |
none | Neither axis. |
PaymentChartUnit
enum PaymentChartUnit · lib/src/charts/chart_models.dart
How a chart reads its values.
| Value | Description |
|---|---|
money | Currency amounts. |
percent | Host-computed percentages, where 45 means 45 percent. |
number | Plain counts or quantities. |
ChartPoint
class ChartPoint · lib/src/charts/chart_models.dart
One period reading, with missing values distinct from zero.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible period or category label. |
value: | Money? | — | Null is missing data, never zero. |
status: | ChartPointStatus | ChartPointStatus.settled | Settlement state; never encoded by a series color. |
spokenLabel: | String? | — | Optional expanded period name for spoken summaries. |
measure: | num? | — | Host-computed quantity; null is missing data. |
MeterSegment
class MeterSegment · lib/src/charts/chart_models.dart
One non-negative category in a meter.
| Parameter | Type | Default | Description |
|---|---|---|---|
label:required | String | — | Visible period or category label. |
value: | Money? | — | Money reading when using currency units. |
status: | ChartPointStatus | ChartPointStatus.settled | Settlement state; never encoded by a series color. |
measure: | num? | — | Host-computed non-negative quantity. |
Parameters: segments, showLegend, unit, onSegmentPressed, semanticLabel.
Filter foundation
Section titled “Filter foundation”Pressable meter legend rows use a label, optional status caption and end-aligned tabular amount. Their 48 dp target remains unchanged; passive legends keep their compact wrap.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Payment method breakdown | money | Show host-computed totals and category labels in legend rows. |
Use Bar chart to compare periods.
States
Section titled “States”The host supplies non-negative category amounts and their status. Use the legend to distinguish settled, pending and unknown values.
Do and don’t
Section titled “Do and don’t”Do: Show host-computed totals and category labels in legend rows.
Don’t: Use success/danger colors to categorize payment methods.
Content guidelines
Section titled “Content guidelines”Use short period labels and a clear title. Explain what is settled in the headline caption. The host supplies the headline; the kit never adds plotted values to produce a customer total.
Accessibility
Section titled “Accessibility”A single generated summary announces settled lowest, highest and latest amounts plus pending, unknown and missing counts. Supply semanticLabel for a host-authored equivalent. Pointer inspection on line/bar charts is supplemental; it has no keyboard focus target. Status is conveyed by shape and words as well as color.
PaymentMeterChart
class PaymentMeterChart extends StatelessWidget · lib/src/charts/charts.dart
A categorical breakdown with optional host actions on legend rows.
| Parameter | Type | Default | Description |
|---|---|---|---|
segments:required | List<MeterSegment> | — | Segments. |
showLegend: | bool | true | Whether to show the series legend. |
unit: | PaymentChartUnit | PaymentChartUnit.money | Which reading to display and announce. |
onSegmentPressed: | ValueChanged<MeterSegment>? | — | On Segment Pressed. |
semanticLabel: | String? | — | Host-authored replacement for the generated summary. |
See also
Section titled “See also”- Chart layout for height, state and headline composition.
- Money for precise and compact amounts.