订单图表卡
一年的每月订单量为条形,今年每个月都在去年旁边,所以比较是逐条读取的。标题用增量标签计算总数,悬停一个月会将其交换为该月的数字和一年前的数字。与收入图表卡具有相同的框架和标题,因此两者共享一行。免费,基于 Recharts。
Orders
25,162
+20%20,968 last year
- This year
- Last year
CLI
手动安装
CLI 将组件源(及其内部依赖项)复制到您的项目中并安装任何所需的 npm 包。
npx boardui@latest add orders-chart-card使用共享 UI 包或自定义导入别名? 配置您的安装路径 在运行 CLI 之前。复制粘贴示例使用默认导入。
你自己的号码
通行证 data 作为十二点 current 和一个 上一个 值。总计、增量和悬停读数均源自它们。 标题 设置静止标题标签。
import { OrdersChartCard, type OrdersPoint,} from "@/components/application/dashboard/orders-chart-card";
// Twelve points, one per month. `current` is this year, `previous` the same// month a year earlier; the headline and the delta are computed from them.const orders: OrdersPoint[] = [ { label: "Jan", current: 1680, previous: 1510 }, { label: "Feb", current: 1740, previous: 1480 }, // ... { label: "Dec", current: 2342, previous: 1798 },];
<OrdersChartCard data={orders} title="Paid orders" />连续
两张免费图表卡都是 flex-1 高度为 344 像素,因此它们均匀地分成一行,就像聊天启动器的仪表盘上一样。
{/* Two free charts in a row; both are 344px tall by default */}<div className="flex flex-col gap-4 xl:flex-row"> <RevenueChartCard /> <OrdersChartCard /></div>