TrendChart

A line, or a filled area with area, over a data array: one point per row, xField along the axis and yField up it. The chart fetches nothing, so pass rows you already have, and a row whose yField is not a finite number is a gap in the line. It is an add-on: import it from @chelone/react/charts or @chelone/vue/charts, and install recharts for React or @unovis/vue and @unovis/ts for Vue.

Installation

pnpm dlx shadcn@latest add @chelone/trend-chart
Loading preview…

A line, or a filled area with area, over a data array: one point per row, xField along the axis and yField up it. The chart fetches nothing, so pass rows you already have, and a row whose yField is not a finite number is a gap in the line. It is an add-on: import it from @chelone/react/charts or @chelone/vue/charts, and install recharts for React or @unovis/vue and @unovis/ts for Vue.

Props

PropTypeDefaultDescription
bareboolean—Leaves out the card and the title.
classNamestring—
colorstring—Any CSS color. Defaults to `var(--primary)`.
datareadonly TRow[]—
heightnumber—In pixels. Defaults to 200.
loadingboolean—
titlestring—
xFieldTX—
yFieldkeyof TRow & string—A row whose value is not a finite number draws no point.
areaboolean—Fills the area under the line with a gradient.
smoothboolean—Draws a smooth curve instead of straight segments.
tooltipFormatter(value: number, name: string) => string—
xTickFormatter(value: TRow[TX]) => string—
yTickFormatter(value: number) => string—