Line chart
PaymentLineChart shows direction across ordered periods, with gaps for missing amounts.



PaymentLineChart(points: points);Use onSelectionChanged to receive each new selected period index and null on return to rest. On touch, a scrub reports null when the finger lifts. The index addresses points or the series’ shared periods. Repeated events within one period do not notify or rebuild. New periods reset selection silently. The kit plays no haptics; add them in your callback if you want them.
import 'package:flutter/services.dart';
PaymentLineChart( points: points, onSelectionChanged: (i) { if (i != null) HapticFeedback.selectionClick(); },);Variants
Section titled “Variants”Variants: one to three series, money, percentage, number.
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.
Exact value at rest (D58)
Section titled “Exact value at rest (D58)”The latest settled period is selected when the chart appears. One label in a fixed band above the plot gives its exact amount, such as “29 Okt · Rp420.000” in tabular figures, and a guide line runs from the point or bar top up to that label. Tap a period to select it, and tap it again to return to the latest. Drag across the plot to scrub: the label follows your finger and returns to the latest when you lift it. With a mouse, hover selects and moving away returns to the latest. The band never changes height, so nothing below the chart moves. A multi-series chart gives each series one line, “29 Okt · Bulan ini · Rp420.000”. When any period’s series name and value don’t fit on one line, as at 200% text on a phone or for a pending period’s longer value, every series shows its name with the value under it. The name wraps to at most two lines, then ends in an ellipsis; a realistic name fits in two. Inside ChartModule the plot area grows by those extra lines, so the plot keeps its height. With inspectable: false the label still shows the latest value and the chart takes no gestures. Series of 12 points or fewer draw a small ring on every settled point; longer series ring the last point. There is no permanent label on every point: those collide at 200% text and in Indonesian.

Sparklines can opt into inspectable, giving a 48 dp target. Press and hold to read a value. 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: points, series, zeroBased, inspectable, axis, grid, showLegend, unit, semanticLabel, onSelectionChanged.
Which variant when
Section titled “Which variant when”| Situation | Variant / composition | Payment example |
|---|---|---|
| Spending over time | one series | Use an explicitly labeled timeline; add series only for a real comparison. |
Use Bar chart for month-versus-month categories.
States
Section titled “States”A missing value leaves a gap. Settled, pending and unknown readings keep distinct line or mark patterns; none is inferred from another reading.
Do and don’t
Section titled “Do and don’t”Do: Use an explicitly labeled timeline; add series only for a real comparison.
Don’t: Hide missing data by inserting zero.
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. The value label is supplemental: the summary already announces the latest amount, and selection has no keyboard focus target. Status is conveyed by shape and words as well as color.
PaymentLineChart
class PaymentLineChart extends StatefulWidget · lib/src/charts/charts.dart
Trends across periods, with gaps for missing readings.
| Parameter | Type | Default | Description |
|---|---|---|---|
points: | List<ChartPoint> | const [] | Single-series points; leave empty when providing series. |
series: | List<PaymentChartSeries> | const [] | Named series with matching period labels; at most three. |
unit: | PaymentChartUnit | PaymentChartUnit.money | Which reading to display and announce. |
axis: | PaymentChartAxis | PaymentChartAxis.both | Axes whose labels are visible. |
grid: | PaymentChartAxis | PaymentChartAxis.y | Axes whose grid rules are visible. |
showLegend: | bool | true | Whether to show the series legend. |
zeroBased: | bool | false | Whether the scale includes zero. |
inspectable: | bool | true | Whether pointer gestures select a reading. |
semanticLabel: | String? | — | Host-authored replacement for the generated summary. |
onSelectionChanged: | ValueChanged<int?>? | — | Called with the index of the period a person's tap, drag or hover selects, and with null when the chart returns to rest. The index addresses points, or the periods all series share. Not called when new points or series reset the selection. Use it to play a selection haptic (D73); the kit plays none. On touch, a drag returns to rest when the finger lifts, and a second tap on the same period clears it. |
See also
Section titled “See also”- Chart layout for height, state and headline composition.
- Money for precise and compact amounts.