TimeseriesChart
Time-series lines and stacked bars: clustered markers, threshold lines, range brushing, full tooltips.
TimeseriesChart
Basic Usage
data is an array of series; each series' data holds time-ordered [timestamp_ms, value] tuples. color is optional — series fall onto the categorical palette by position, and positions are stable, so hiding one series never recolors the rest. Hovering opens the tooltip: rows sort by value descending, duplicate names dedupe, and values resolve by binary-searching the nearest sample.
Two-series lines
Lines + axis formatting
xAxisTickFormat / tooltipValueFormat customize tick and value text.
Markers & Thresholds
markers draw vertical dashed lines on the time axis; markers that crowd together cluster into one line based on the visible span, the label becomes "N changes" (clusterLabel overrides the wording), and hovering the line lists each marker's label and description. thresholds draw horizontal lines on the value axis, and the y domain extends automatically to cover them.
Deploy markers + SLO line
Markers + Thresholds
The last two markers sit close together and cluster.
Gradient & Incomplete Data
gradient adds a vertical fill under each line (series color at 40% → transparent). incomplete declares data outside [before, after] as incomplete: edge segments render dashed and overlap the solid segment by one sample so the line stays connected.
Gradient + dashed edges
Gradient + Incomplete
The first and last three hours are incomplete periods.
Stacked Bars
With type="bar" every series stacks automatically (kumo's stack: 'total'), and the y domain covers each timestamp's stacked total.
Daily stacks
Stacked bars
Three series share one bar per day.
Time Range Selection
Attaching a time-range-change listener enables horizontal brushing: drag on the plot to draw a selection; releasing emits (from, to) in milliseconds and clears the selection. Drags under 3px count as clicks and do nothing.
Drag to select
Brush selection
The readout below shows the selected range.
Legend Interplay
v-model:hidden-series two-way binds the hidden series names: hidden series neither render nor appear in tooltips. highlighted-series emphasizes one series and dims the rest to 30% opacity. Combine both with TxChartLegendItem for a clickable, hover-highlighting legend.
Click to hide + hover to highlight
Legend interplay
Click legend items to toggle; hover to highlight.
Loading Skeleton
loading swaps the chart for a harmonic-wave skeleton; the line and bar variants share one silhouette, and the shimmer respects prefers-reduced-motion.
Skeleton loop
Loading skeleton
Loading toggles on a loop, alternating the line and bar variants.
API
TimeseriesChart Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | TimeseriesData[] | — | { name, data: [ts, value][], color? }; missing color falls onto the categorical palette by position. |
type | 'line' | 'bar' | 'line' | Bars stack automatically. |
markers | TimeseriesMarker[] | — | { timestamp, label?, description?, color?, lineStyle? }. |
thresholds | TimeseriesThreshold[] | — | { value, label?, color }; the y domain extends to cover them. |
xAxisName / yAxisName | string | — | Axis names. |
xAxisTickCount / yAxisTickCount | number | 5 | Suggested tick counts. |
xAxisTickFormat / yAxisTickFormat | (v: number) => string | — | Tick formatters. |
tooltipValueFormat | (v: number) => string | raw value | Tooltip value formatter. |
tooltipMode | 'all' | 'single' | 'all' | single shows only the series closest to the cursor's y value. |
tooltipMaxItems | number | 10 | Overflow folds into "+N more". |
tooltipFollowCursor | 'both' | 'x' | 'both' | x pins the vertical position to avoid jitter. |
incomplete | { before?, after? } | — | Incomplete periods (line type only). |
gradient | boolean | false | Gradient fill under lines. |
loading | boolean | false | Skeleton state. |
highlightedSeries | string | null | — | Emphasized series; the rest dim to 30% opacity. |
height | number | 350 | Pixel height. |
width | number | measured | Explicit width (SSR/tests). |
ariaDescription | string | — | Accessible description (svg role="img"). |
clusterLabel | (n: number) => string | n => `${n} changes` | Cluster label wording. |
timestampFormat | (ts: number) => string | compact locale | Tooltip timestamp format. |
TimeseriesChart Events
| Event | Payload | Description |
|---|---|---|
time-range-change | (from: number, to: number) | Brush finished. Attaching it enables brushing. |
update:hiddenSeries | (names: string[]) | v-model:hidden-series write-back. |
Differences from kumo
enableLegendSelection+ imperative echarts actions → declarativev-model:hidden-series; highlighting viahighlighted-series.tooltipBoundary(clipping-ancestors collision) is simplified to container clamping + viewport flipping.- No 30% out-of-brush dimming during the drag (kumo's transient outOfBrush) — only the selection rectangle renders.
- Keep each series under ~5k points: SVG rendering degrades in the tens of thousands.