01
Overview
Responsive SVG frequency-bin bar chart for visualizing audio spectrum magnitude data.
Usage
Guidance
Use When
- Displaying pre-computed frequency-domain magnitude data from an FFT or spectrum analyzer.
- Showing a static frequency response or spectrum snapshot with labelled frequency bins.
Avoid When
- Real-time live audio spectrum is needed — feed live AnalyserNode data as props yourself.
- A full time × frequency heatmap is needed — use spectrogram instead.
- General categorical bar comparison — use bar-chart instead.
Rendering and theming
SpectrumChart uses SVG and derives guide margins from its formatted frequency and magnitude labels. Its foreground follows currentColor, its background defaults to transparent, and the spectrum marks use the first resolved --cinder-chart-series-* color. Pass a partial theme to override the palette or chart colors, including the rendered chart background; the semantic data table remains available independently of the visual theme.
02
When to use
Use when
- Displaying pre-computed frequency-domain magnitude data from an FFT or spectrum analyzer.
- Showing a static frequency response or spectrum snapshot with labelled frequency bins.
Avoid when
- Real-time live audio spectrum is needed — feed live AnalyserNode data as props yourself.
- A full time × frequency heatmap is needed — use spectrogram instead.
- General categorical bar comparison — use bar-chart instead.
03
Examples
Frequency spectrum
Pre-computed FFT magnitude spectrum showing frequency content of a signal.
04
Props
| Name | Type | Default | Description |
|---|---|---|---|
label required | text | Accessible label for the chart. Required for screen readers. | |
description | text | Optional description rendered below the label. | |
bins required | SpectrumBin[] | Frequency bins with label + magnitude value. | |
height | number | 160 | Pixel height of the chart. Default 160. |
loading | boolean | false | Whether the chart is in a loading state. |
dataTableVisibility | 'screen-reader-only' | 'visible' | 'hidden' | 'screen-reader-only' | Controls data table visibility. Default screen-reader-only. |
dataTableCaption | text | Custom data table caption; falls back to label. | |
theme | ChartTheme | Partial visual theme override. Omitted fields inherit the surrounding application. | |
empty | snippet | Snippet rendered when there are no bins. | |
loadingContent | snippet | Snippet rendered while loading. | |
id | text |