Chart
A simple native bar chart.
Import
import { Chart } from "@tarve/core";Usage
import { Chart } from "@tarve/core";
<Chart
height={200}
data={[
{ label: "Jan", value: 186 },
{ label: "Feb", value: 305 },
{ label: "Mar", value: 237, color: "#7c5cff" },
{ label: "Apr", value: 73 },
]}
/>Props
| Prop | Type | Default |
|---|---|---|
data required | readonly ChartDatum[] | — |
barWidth | number | 36 |
height | number | 180 |
max | number | — |
showLabels | boolean | true |
showValues | boolean | true |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyleTypes
interface ChartDatum {
label: string;
value: number;
color?: string;
}