Status | Amount | Posting Date | |
---|---|---|---|
success | ken99@yahoo.com | 316 | 2023-01-01 |
success | Abe45@gmail.com | 242 | 2023-01-03 |
processing | Monserrat44@gmail.com | 837 | 2023-01-05 |
success | Silas22@gmail.com | 874 | 2023-01-07 |
failed | carmella@hotmail.com | 721 | 2023-01-09 |
processing | Jane21@yahoo.com | 545 | 2021-02-22 |
success | John29@outlook.com | 854 | 2021-11-13 |
failed | Chris34@gmail.com | 611 | 2021-04-05 |
success | Taylor72@hotmail.com | 422 | 2020-12-07 |
processing | Alex18@gmail.com | 688 | 2021-05-09 |
- Built with
shadcn charts
/recharts
- Chart and table are synced: updated in one, reflected in the other
- Drag on the chart to filter the table
- Edit chart display from the menu
- Copy the single file source code
1
Import LinkedChart in your DataTable component
import { LinkedChart } from '@/components/linked-chart'
2
Define how you want to aggregate the data for the chart
const chartAggregatorConfig = {
amount: (transaction: any) => (transaction.amount > 0 ? transaction.amount : 0),
largeAmount: (transaction: any) => (transaction.amount > 500 ? transaction.amount : 0),
};
3
Call the LinkedChart component inside your DataTable
<LinkedChart
data={table.getFilteredRowModel().rows.map((row) => row.original)}
columns={columns}
setColumnFilters={table.setColumnFilters}
dateField="posting_date_unix"
aggregatorConfig={chartAggregatorConfig}
chartType="area"
title="Linked Chart"
/>
made by @asisbot