Skip to content

Line chart

Responsive line chart with a CSS-only renderer.

Browsers
Chrome 123+Firefox 121+Safari 17.5+
Tier
0
Forced layout budget
0 ms
Axe budget
0
SSR compatible
Yes
Published contract
Test harness

Playground

Line chart

48 weekly values with CSS geometry, automatic axes, and an optional interactive client entry.

CSS-only chart

Weekly revenue
TimeValue
2025-01-0189
2025-01-0892.3
2025-01-1595.5
2025-01-2298.3
2025-01-29100.6
2025-02-05102.4
2025-02-12103.5
2025-02-19104.1
2025-02-26104.1
2025-03-05103.7
2025-03-12102.9
2025-03-19102
2025-03-26101
2025-04-02100.2
2025-04-0999.8
2025-04-1699.7
2025-04-23100.2
2025-04-30101.3
2025-05-07103
2025-05-14105.2
2025-05-21107.8
2025-05-28110.8
2025-06-04114
2025-06-11117.3
2025-06-18120.4
2025-06-25123.3
2025-07-02125.8
2025-07-09127.8
2025-07-16129.3
2025-07-23130.3
2025-07-30130.8
2025-08-06130.9
2025-08-13130.8
2025-08-20130.5
2025-08-27130.3
2025-09-03130.2
2025-09-10130.5
2025-09-17131.2
2025-09-24132.4
2025-10-01134.2
2025-10-08136.5
2025-10-15139.3
2025-10-22142.6
2025-10-29146.1
2025-11-05149.8
2025-11-12153.4
2025-11-19156.8
2025-11-26159.9

Interactive chart

Interactive weekly revenue
2025-11-26159.9
  1. Jan 25
  2. Feb 25
  3. Mar 25
  4. Apr 25
  5. May 25
  6. Jun 25
  7. Jul 25
  8. Aug 25
  9. Sep 25
  10. Oct 25
  11. Nov 25
  1. 159.9
  2. 145.72
  3. 131.54
  4. 117.36
  5. 103.18
  6. 89
TimeValue
2025-01-0189
2025-01-0892.3
2025-01-1595.5
2025-01-2298.3
2025-01-29100.6
2025-02-05102.4
2025-02-12103.5
2025-02-19104.1
2025-02-26104.1
2025-03-05103.7
2025-03-12102.9
2025-03-19102
2025-03-26101
2025-04-02100.2
2025-04-0999.8
2025-04-1699.7
2025-04-23100.2
2025-04-30101.3
2025-05-07103
2025-05-14105.2
2025-05-21107.8
2025-05-28110.8
2025-06-04114
2025-06-11117.3
2025-06-18120.4
2025-06-25123.3
2025-07-02125.8
2025-07-09127.8
2025-07-16129.3
2025-07-23130.3
2025-07-30130.8
2025-08-06130.9
2025-08-13130.8
2025-08-20130.5
2025-08-27130.3
2025-09-03130.2
2025-09-10130.5
2025-09-17131.2
2025-09-24132.4
2025-10-01134.2
2025-10-08136.5
2025-10-15139.3
2025-10-22142.6
2025-10-29146.1
2025-11-05149.8
2025-11-12153.4
2025-11-19156.8
2025-11-26159.9

Live stream

A simulated trade feed appends one finished one-minute close every second; existing points never move. Every point lives in a horizontal VirtualScroll sized to show 20 at a time: scroll back through the history, and the chart follows new points again once you return to the newest one.

Live ETH / USD one-minute closes
10:293152.46
  1. 10:05
  2. 10:10
  3. 10:15
  4. 10:20
  5. 10:25
  1. 3,166.96
  2. 3,161.74
  3. 3,156.52
  4. 3,151.31
  5. 3,146.09
  6. 3,140.87
TimeValue
10:103166.96
10:113160.48
10:123154.88
10:133151.27
10:143156.95
10:153156.64
10:163153.31
10:173151.54
10:183148.18
10:193146.15
10:203144.78
10:213145.29
10:223143.28
10:233146.33
10:243142.35
10:253140.87
10:263149.75
10:273152.42
10:283154.24
10:293152.46

API

LineChart

PropTypeDefaultDescription
data*readonly LineChartData[]—Time/value records used to draw the line.
aria-labelstring"Line chart"Accessible name used for the chart and its data table.
xAxisreadonly LineChartAxisLabel[]—Optional custom bottom-axis labels. Each item supplies arbitrary React content and a position from 0 to 100 percent.
yAxisreadonly LineChartAxisLabel[]—Optional custom right-axis labels. Each item supplies arbitrary React content and a position from 0 to 100 percent.
interactiveboolean—Enables point hit areas, crosshair state, keyboard activation, and the React-rendered value readout; LineChartClient sets this automatically.
renderReactElement | ((props, state) => ReactElement)—Replace the rendered element while keeping behavior and accessibility wiring.

LineChartClient (@gunkin/uiify/components/line-chart/client)

PropTypeDefaultDescription
data*readonly LineChartData[]—The same time/value data as LineChart; the client adds wheel zoom, horizontal scrolling, an endpoint-snapped crosshair, keyboard point selection and a value readout.
visibleCountnumber—Live mode: N points fill the viewport; history is virtualized. Axes, readout and table track visible points; the chart follows new ones unless scrolled back, with zoom and announcements off.

Keyboard

KeyAction
TabFocus an interactive point
Enter / SpaceSelect the focused point and update the readout

Accessibility

The static line is decorative and the figure includes a visually hidden table with the original time and value pairs. The optional client entry makes points keyboard-focusable, adds wheel zoom, native horizontal scrolling, a snapped crosshair, and a live value readout while preserving that table.

Styling hooks

data-uiify-line-chartdata-interactivedata-trenddata-timedata-crosshair-activedata-axis--line-y--line-prev-y--line-slot--line-count--line-scale--line-axis-x--line-axis-y--line-crosshair-x--line-cursor-y