000 / RECHARTS / LINE
Basic Line Chart
Responsive single-series Cartesian line chart with pointer tooltips, smooth monotone curves, and keyboard exploration.
- SPEC
- #000
- ENGINE
- Recharts
- FAMILY
- Line
- RENDERER
- svg
- STATUS
- stable
Installation
Checking public registry…
View local registry JSONCopied as source into your project (requires recharts).
- BEST FOR
- Basic Line Chart visual analytics and line category telemetry.
- DATA MODEL
- Normalized line records matching canonical dataShape.
- INTERACTION
- Pointer hover and focus crosshairs
- RESPONSIVE
- Container-aware ResizeObserver
- ANIMATION
- Interpolated transitions
- RUNTIME
- Recharts svg
Basic & Interactive Integration
Import LineBasic directly into your React client component. Provide an array of observations conforming to the data shape.
Requires a client context ('use client') for DOM lifecycle and container measurement.
Input Schema & Coordinates
Input data format for Basic Line Chart. Records should provide required coordinates and metrics.
| Field | Type | Required | Meaning |
|---|---|---|---|
label | string | Yes | Category label or horizontal axis timestamp |
value | number | Yes | Metric numerical magnitude |
Missing values are gracefully handled or skipped depending on interpolation rules.
Records should follow monotonic sorting for sequential coordinate plots.
Props Reference & Interactive Prop Explorer
Inspect every component property, customize semantic color roles live with instant visual feedback, and copy production-ready code with active prop configurations.
Colors & Appearance Configuration
Customize primary, reference, or annotation series colors. Defaults derive from Plotcn theme tokens.
<LineBasic
data={data}
xKey="date"
seriesKey="value"
/>Primary theme stroke or fill color. Accepts CSS variables or color values.
color="#10b981"Default: "var(--chart-1, #10b981)"| Property | Type | Default | Required | Description |
|---|---|---|---|---|
dataReq | Record<string, any>[] | — | Yes | Array of structured observations or datum objects to visualize. Best for: Primary dataset |
colorOpt | string | "var(--chart-1, #10b981)" | No | Primary theme stroke or fill color. Accepts CSS variables or color values. Best for: Theming and visual branding |
heightOpt | number | string | 320 | No | Container height in pixels or standard CSS dimension strings. |
classNameOpt | string | undefined | No | Tailwind CSS classes or custom stylesheet class applied to container wrapper. |
Component Variants & Edge States
Production cookbooks showcasing configuration variants alongside verified handling of loading, empty data, and network error states.
Basic Line Chart (Default)
Standard presentation with Plotcn dark theme tokens.
Skeletons indicate runtime fetch or pending data queries.
Handles empty collections ([]) gracefully without crashing.
Graceful failure banner when data source or script fails.
Container-Driven Breakpoints
Scales gracefully according to container width, recalculating layout bounds.
Full horizontal scale and complete axis tick labeling.
Tighter margins with optimized coordinate grid spacing.
Compact labels and touch-friendly interaction.
Accessibility & Navigation Standards
Accessible visualization presenting Basic Line Chart data with semantic contrast.
Container mounts as figure[role="region"] with explicit assistive label.
Coordinate baselines and labels preserve data legibility regardless of color perception.
Embeds visually hidden summary (.sr-only) declaring: “Basic Line Chart data visualization”
Suppresses transitions when user prefers reduced motion.
| Key | Action |
|---|---|
| Tab | Focus chart container and navigate through interactive regions. |
Internal Architecture & File Dependencies
Source-first ownership model. Inspect the exact component call tree, dependencies, and full implementation below.
Visualization calculations and rendering via Recharts.