Charts
Line chart
Engineering traces with limits, bands, markers, a synced crosshair, keyboard reading and downsampling.
npx dtheo@latest add line-chartTorque step response
Torque in N·m · Bench 3 · 8.0 N·m step · 1 kHz
- R-0412 measured
- R-0409 reference
- Command
- ±2 % settling band
- Over limit
Use the left and right arrow keys to read values. Hold Shift for larger steps.
When to use
- Step responses, time series, sensor traces
- Comparing a run against a reference
- Two measures with different units on one axis: use two synced charts
API
x- Shared, sorted x values.
ArrayLike<number> series- id, label, values, tone, width (2 = the story, 1.5 = reference, 1 = context).
LineSeries[] yDomain- One y-axis. Never two.
[number, number] thresholds- Dashed limit lines; `shadeSeries` shades where a series crosses.
Threshold[] bands- Tolerance bands, e.g. ±2 % settling.
Band[] markers- Labelled points: the peak, the extreme, the one value the story is about.
Marker[] syncId- Charts with the same id share one crosshair.
string extraReadout- Add values from other charts to the tooltip.
(index) => ReadoutRow[]
Keyboard
- Arrow leftright
- Move the readout by 1% of the range
- Shift + arrow
- Move by 5%
- HomeEnd
- Jump to the start or end
- Escape
- Hide the readout
- The chart has a label that states the takeaway; the keyboard readout is announced politely.
- Identity is carried by the legend and line weight, never color alone.
- Pair it with a sample table for exact values.