Histogram
A frequency-distribution chart: bins continuous values into equal-width
buckets and renders the counts as a BarChart. Useful for benchmark
distributions, latency percentiles, request-size histograms.
See also: BarChart for values you already have per category.
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
// Pass raw samples; the chart buckets them into equal-width bins.Histogram(values: latenciesMs, bins: 7, showValues: true)Details
Section titled “Details”Range defaults to autoscaled [min(values), max(values)]. Bin labels
are the midpoint of each bucket; when they would collide, only an evenly
spaced subset is shown, and showLabels: false turns them off.
Screen readers and agents get one chart node: semanticLabel plus the
bin count, how many values fell in the range, and the range’s low and high
ends, not a node per bin.
Constructors
Section titled “Constructors”Histogram()
Section titled “Histogram()”| Parameter | Type | Default | Description |
|---|---|---|---|
values: | List<num> | required | Raw observations to bin. |
bins: | int | 10 | Number of equal-width bins (≥ 1). |
range: | (num, num)? | — | Explicit (low, high) range. null autoscales to [min, max] of values. Values outside the range are dropped. |
showLabels: | bool | true | Whether bars show their bin midpoint labels. When labels would collide, only an evenly spaced subset is shown. |
showValues: | bool | false | Whether each bar shows its observation count. |
barWidth: | int | 2 | Width of each bar in terminal cells. |
gap: | int | 0 | Horizontal gap between adjacent bars in terminal cells. |
color: | Color? | — | Bar color override; defaults to the theme’s primary. |
semanticLabel: | String | 'Histogram' | Label exposed through the semantic app graph. |
Source
Section titled “Source”Histogram is defined in packages/fleury/lib/src/catalog/histogram.dart.
Category: Charts & meters · All widgets