Profit / Loss Line
One line split exactly at zero. Above it the line and a soft fill are bone; below it the line drops to a cool grey with a hatch beneath, so a loss reads as money gone rather than as a colour.
$149 once · every Pro piece
The zero baseline is the one bright rule. The best and worst points carry quiet rings and pills that only take the accent while the cursor sits on them, and the crosshair snaps to them and to every zero crossing (Shift + arrows jump between them). The cursor dot takes the tone of its side. The legend's Profit and Loss rows isolate one sign or hide it, and the axis tweens to what is left.
Install
npx shadcn@latest add @obsyde/profit-loss-lineNeeds your licence key · Get Pro
Usage
Import it from where the CLI puts it, or copy the files below by hand.
import { ProfitLossLine } from '@/components/obsyde/ember/profit-loss-line/ProfitLossLine';
export function Example() {
return (
<ProfitLossLine
profitFill="gradient"
lossFill="pattern"
pattern="diagonal-up"
extremes
legend="row"
/>
);
}
Files
What you get with Pro: plain React, TypeScript and CSS, with no dependencies.
ember/profit-loss-line/ProfitLossLine.tsxcomponentember/profit-loss-line/profit-loss-line.cssstylesember/profit-loss-line/ProfitLossLineDemo.tsxdemoember/viz-kit/viz-kit.csssharedember/viz-kit/Tooltip.tsxsharedember/viz-kit/focus.tssharedember/viz-kit/patterns.tsxsharedember/viz-kit/roll.tssharedember/shared/rolling-number.csssharedember/shared/spring.tssharedember/shared/accent.tssharedember/viz-kit/scale.tssharedember/viz-kit/motion.tssharedember/viz-kit/chart.tsxsharedember/shared/ember.csssharedember/viz-kit/touch.tssharedember/viz-kit/keyboard.tssharedember/viz-kit/size.tssharedember/viz-kit/States.tsxsharedember/viz-kit/shape.tssharedember/viz-kit/series.tsxsharedember/viz-kit/Legend.tsxsharedember/viz-kit/Grid.tsxsharedember/viz-kit/demo.tsxsharedember/viz-kit/demo.csssharedember/viz-kit/Axis.tsxshared
API
| Prop | Type | Default |
|---|---|---|
accentAccent | 'ember' | 'volt' | 'arc' | 'ember' |
profitFillProfit fill | 'gradient' | 'solid' | 'none' | 'gradient' |
lossFillLoss fill | 'pattern' | 'gradient' | 'none' | 'pattern' |
extremesHigh and low | boolean | true |
legendLegend | 'row' | 'list' | 'none' | 'row' |
tooltipTooltip | 'panel' | 'corner' | 'none' | 'panel' |
crosshairCrosshair | 'solid' | 'dashed' | 'gradient' | 'none' | 'solid' |
dotsDots | 'halo' | 'ring' | 'none' | 'halo' |
patternPattern | 'diagonal-up' | 'diagonal-down' | 'dots' | 'vertical' | 'crosshatch' | 'diagonal-up' |
backgroundBackground | 'grid' | 'dots' | 'hatch' | 'none' | 'grid' |
curveCurve | 'monotone' | 'linear' | 'catmull' | 'step' | 'monotone' |
revealReveal | 'sweep' | 'cool' | 'rise' | 'fade' | 'none' | 'sweep' |
statusStatus | 'ready' | 'loading' | 'empty' | 'ready' |
heightHeight | number | 260 |
pointsPoints | number | 40 |
seedSeed | number | 5 |