Freight-aware margin: revenue distribution (bar with freight pop-out, or waterfall), the margin band histogram with its tail by customer, lane or mode, the month-on-month margin bridge, month trend bars.
Axis starts at $366k.
Margin after freight rose $41.6k, most of it volume from Hill Country Markets and Atlas Foods Co., partly offset by LTL freight on the Laredo lane. [1][2][3]
41 customers in both months, 3 new, 2 lost. A customer new this month counts all its margin as new; a lost one all of last month's.
Click a figure: what it would open shows here.
Part of High Command Pro. The preview and props are open to everyone; installing it needs your license key. Set up your key · Pricing
$ npx shadcn@latest add @highcommand/margin-chartsCopies the source into your project and pulls in what it needs (6 other items). First time? Add the registry to components.json.
Where revenue went: product cost, freight and margin after freight, as a bar or a waterfall.
frequiredMarginFigures—The scope's revenue, costs and margin figures.
variant'bar' | 'waterfall'—'bar' (default) or 'waterfall'
compactboolean—A shorter bar (the account profile's Margin section); bar variant only.
stickyboolean—The account profile: the waterfall drops on the first hover, focus or tap and then stays down.
<Pct />3 propsA percent that does not exist (no revenue, or no gross margin) is plain text, not a number button.vrequiredSourcedValue—The percent figure; a null value prints a dash.
tone'late' | 'at_risk'—Status colour for the figure.
classNamestring—Extra class on the figure.
<TrendBars />2 propsMargin after freight % by order month; a month with no counted orders shows a dash.trendrequired{ month: string; margin_pct: SourcedValue }[]—One bar per order month (YYYY-MM), oldest first; the last month is marked with an asterisk.
compactboolean—A tighter layout with whole-number values.
<Money />3 propsA compact money figure ($2.29M, $414k, $9,950) that opens its source records.vrequiredSourcedValue—The money figure.
tone'late' | 'at_risk'—Status colour for the figure.
classNamestring—Extra class on the figure.
<MarginBandChart />6 propsA histogram of orders by margin after freight %, with an optional switch to the tail of negative-margin orders by customer, lane or mode.bandrequiredreadonly MarginBandBin[]—Every order placed in a bin of its margin after freight %.
marginPctrequiredSourcedValue—The company's margin after freight %, in the qualifier.
underWaterrequiredSourcedValue—Orders under water (margin below zero), in the qualifier.
tails{ customer?: readonly MarginTailRow[]; lane?: readonly MarginTailRow[]; mode?: readonly MarginTailRow[] }{}The tail by customer, lane or mode (each view shows when given).
basisReactNode—The cost basis note at the qualifier's end ("Avg. purchase cost").
onSelectChartSelect—A bin or tail row was activated (default: the page opens its `sv`).
<BridgeBox />5 propsPattern 04, concept B (phase 10): why margin after freight moved, behind the month chart.bridgerequiredBridge—Why margin moved between two months: its figures, steps and sentence.
onMonth(month: string) => void—Earlier / Later: load the bridge of another month (from `bridge.months`). Without it the arrows are hidden.
onStep(step: BridgeStep, bridge: Bridge) => void—A bar's label was activated: open the customers, SKUs or lanes behind it, largest first.
citeHref(c: { type: string; id: string }) => string—Where a cited record opens. Without it the citations are plain numbers.
defaultOpenbooleanfalseStart with the bridge open (default: closed until Explain is pressed).
cents(v: SourcedValue): numberFreight-aware margin: shared pieces of the margin charts (the distribution, the band, the bridge).
pctText(v: SourcedValue): stringA percent to one decimal ("12.3%"); "—" when the value is null.
moneyText(v: SourcedValue): string$2.29M, $414k, $9,950: one compact style for every amount on these screens (cents in the records panel).
marginTone(v: SourcedValue): "late" | undefinedColour means status only: a margin below zero is late (losing money); freight eating half the gross margin or more is at risk.
shareTone(v: SourcedValue): "late" | "at_risk" | undefinedStatus for freight as a share of gross margin: late from 100%, at risk from 50%, else none.
monthLabel(ym: string, short?: boolean): string"YYYY-MM" as "Oct 2026", or "Oct" with `short`.