Chart
Original SVG charts. Four views, one small API and every value within reach.
Interactive preview
View data
| Label | Value |
|---|---|
| Mon | 24 |
| Tue | 38 |
| Wed | 31 |
| Thu | 56 |
| Fri | 44 |
| Sat | 68 |
| Sun | 61 |
Usage
import { Chart } from "@devvy-ui/react";
<Chart title="Weekly activity" type="bar" data={[
{ label: "Mon", value: 24 },
{ label: "Tue", value: 38 },
{ label: "Wed", value: 31 },
]} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| data | readonly ChartDatum[] | required | Label/value pairs; finite numbers. |
| title / description | string | required / — | Visible chart caption and optional context. |
| type | bar | line | area | donut | bar | Single-series visualization. |
| valueFormatter | (number) => string | compact number | Formats axes and values. |
| dataLabel / emptyLabel | string | View data / No data to display. | Disclosure and empty-state copy. |
Accessibility & behavior
Platform Behavior & Guidelines
An accessible named SVG, visible caption and native data-table disclosure. Bar, line and area support signed values. Donuts require nonnegative values and a positive finite total. Nonfinite values are omitted; unsupported/empty data shows the empty state. Axis labels shorten visually; the table retains full labels. Single series; aggregate large datasets before rendering. Theme with --dvy-chart-color and --dvy-chart-series-1 through -4. No new dependency or animation.
Source ownership
Add the audited implementation directly into your repository with the CLI:
node /path/to/devvy-ui/packages/cli/src/cli.mjs add chartMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.