Installation
Install and set up Reincharts in your React application.
Requirements
Before installing, make sure you have the following:
- React
- Node.js
- A node package manager
Installation Methods
Or install individual packages as needed:
The list of packages can be found on the Packages Overview section of the introduction page.
Setup
After installation, you can import components from the aggregated entry point or per-package imports:
// Aggregated import
import { ChartCanvas, Chart, XAxis, YAxis } from "reincharts";
// Or per-package imports
// import { ChartCanvas, Chart } from "@reincharts/core";
// import { XAxis, YAxis } from "@reincharts/axes";
// import { LineSeries } from "@reincharts/series";
// import { discontinuousTimeScaleProviderBuilder } from "@reincharts/scales";
TypeScript Support
This library includes TypeScript definitions out of the box. No additional installation is required.
import type { LineSeriesProps } from "@reincharts/series";
type Data = { date: Date; value: number };
const accessor: LineSeriesProps["yAccessor"] = (d: Data) => d.value;
Next Steps
Now that you have Reincharts installed, you're ready to build your first chart.