Unreleased APIs from PR #2. Not in 0.2.1. Stable 0.2.1 reference.
LOOM Unreleased (PR #2) / PLOTTING AND CALENDARS
BarChart
Grouped fractional bars in terminal cells, with caller-supplied labels and appearance.
Vertical bars grow upward and reserve bottom rows for nonempty bar/group labels. Horizontal bars grow rightward, reserve a shared left label gutter, and place group labels above their bars. Values are drawn inside bars at the baseline or left edge. Bar width is columns for vertical charts and rows for horizontal charts; gaps are nonnegative. Labels and values use one unwrapped row and clip at whole graphemes. Empty groups consume no space. Negative and non-finite data render as zero.
Standard inherited Swift protocol operations such as synthesized equality and OptionSet set operations are not repeated. The public declarations below are extracted from the exact source revision listed in the coverage manifest.
Example
_ = BarChart(groups: [BarGroup([Bar(12, label: "GET"), Bar(7, label: "POST")], label: "API")])Members on this page
Feature guides and release status
BarChart
struct BarChartConforms to: Widget.
Grouped fractional bars in terminal cells, with caller-supplied labels and appearance.
Vertical bars grow upward and reserve bottom rows for nonempty bar/group labels. Horizontal bars grow rightward, reserve a shared left label gutter, and place group labels above their bars. Values are drawn inside bars at the baseline or left edge. Bar width is columns for vertical charts and rows for horizontal charts; gaps are nonnegative. Labels and values use one unwrapped row and clip at whole graphemes. Empty groups consume no space. Negative and non-finite data render as zero.
Source · BarChart.swift:69groups
var groups: [BarGroup]A public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:70direction
var direction: DirectionThe horizontal or vertical allocation axis.
Source · BarChart.swift:71barWidth
var barWidth: IntA public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:72barGap
var barGap: IntA public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:73groupGap
var groupGap: IntA public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:74maximum
var maximum: Double?A public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:75style
var style: StyleVisual attributes used when painting this value.
Source · BarChart.swift:76barStyle
var barStyle: Style?Optional complete replacement styles; nil inherits the chart or resolved bar appearance.
Source · BarChart.swift:78labelStyle
var labelStyle: Style?A public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:79groupLabelStyle
var groupLabelStyle: Style?A public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:80valueStyle
var valueStyle: Style?A public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:81showsValues
var showsValues: BoolA public field of this type. Its value type and mutability are shown in the declaration.
Source · BarChart.swift:82init(groups:maximum:)
init(groups: [BarGroup], maximum: Double? = nil)Creates a value with the supplied arguments. Default arguments are shown in the declaration.
Parameters (2)
groups- Argument type and any default are shown in the declaration; see the behavior notes above.
maximum- Argument type and any default are shown in the declaration; see the behavior notes above.
init(bars:maximum:)
init(bars: [Bar], maximum: Double? = nil)Places ungrouped bars in a single group without a group label.
Parameters (2)
bars- Argument type and any default are shown in the declaration; see the behavior notes above.
maximum- Argument type and any default are shown in the declaration; see the behavior notes above.
render(in:buffer:)
func render(in area: Rect, buffer: inout Buffer)Paints this widget into the assigned terminal-cell rectangle. Application code owns state, input routing, and terminal lifetime.
Parameters (2)
in- Argument type and any default are shown in the declaration; see the behavior notes above.
buffer- Mutable destination cell grid.