Skip to content
Get started
Menu
Get started

Meter chart

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

Category spending amounts shown as horizontal meters.Category spending amounts shown as horizontal meters.
Meter chart
Category spending amounts shown as horizontal meters at 200 percent text.
200% text
example/lib/screens/gallery_charts.dart
PaymentMeterChart(
segments: [
for (final p in points)
if (p.value != null)
MeterSegment(label: p.label, value: p.value!, status: p.status),
],
);

Variants: money, percentage, number; up to five categories.

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.

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.

ParameterTypeDefaultDescription
label:requiredString—Legend and spoken name.
points:requiredList<ChartPoint>—One point per period.

PaymentChartAxis

enum PaymentChartAxis · lib/src/charts/chart_models.dart

Axes to label or grid.

ValueDescription
xHorizontal axis.
yVertical axis.
bothBoth axes.
noneNeither axis.

PaymentChartUnit

enum PaymentChartUnit · lib/src/charts/chart_models.dart

How a chart reads its values.

ValueDescription
moneyCurrency amounts.
percentHost-computed percentages, where 45 means 45 percent.
numberPlain counts or quantities.

ChartPoint

class ChartPoint · lib/src/charts/chart_models.dart

One period reading, with missing values distinct from zero.

ParameterTypeDefaultDescription
label:requiredString—Visible period or category label.
value:Money?—Null is missing data, never zero.
status:ChartPointStatusChartPointStatus.settledSettlement 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.

ParameterTypeDefaultDescription
label:requiredString—Visible period or category label.
value:Money?—Money reading when using currency units.
status:ChartPointStatusChartPointStatus.settledSettlement state; never encoded by a series color.
measure:num?—Host-computed non-negative quantity.

Parameters: segments, showLegend, unit, onSegmentPressed, semanticLabel.

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.

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.

The host supplies non-negative category amounts and their status. Use the legend to distinguish settled, pending and unknown values.

Do: Show host-computed totals and category labels in legend rows.

Don’t: Use success/danger colors to categorize payment methods.

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.

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.

ParameterTypeDefaultDescription
segments:requiredList<MeterSegment>—Segments.
showLegend:booltrueWhether to show the series legend.
unit:PaymentChartUnitPaymentChartUnit.moneyWhich reading to display and announce.
onSegmentPressed:ValueChanged<MeterSegment>?—On Segment Pressed.
semanticLabel:String?—Host-authored replacement for the generated summary.
  • Chart layout for height, state and headline composition.
  • Money for precise and compact amounts.