Skip to contentVibraUI

Orders by weekday

Every order on the book, by the day of the week it was placed; reads ordersByWeekday().

Preview

Install

npx shadcn@latest add @vibra/widget-ecommerce-orders-overview-orders-by-weekday

Needs the @vibra registry in your components.json — set it up once.

Source

app/ecommerce/orders/overview/components/orders-by-weekday.tsx
"use client"

import { formatNumber } from "@/lib/format"
import { BarChart } from "@/components/ui/bar-chart"
import { ChartCard } from "@/components/ui/chart-card"

const SERIES = [{ key: "orders", label: "Orders", color: "chart-1" as const }]

const count = (value: number) => formatNumber(value, { maximumFractionDigits: 0 })

/** Where the week's volume actually sits, across the whole book. */
export function OrdersByWeekday({ rows }: { rows: { day: string; orders: number }[] }) {
  return (
    <ChartCard
      data-widget="widget-ecommerce-orders-overview-orders-by-weekday"
      title="Orders by weekday"
      description="Every order on the book, by the day it was placed"
      height={240}
      className="h-full"
    >
      <BarChart
        data={rows}
        index="day"
        series={SERIES}
        height={240}
        showYAxis
        valueFormatter={count}
      />
    </ChartCard>
  )
}

Its page

On its page the card sits among the rest of the dashboard and shares its range and its data with them.

From the Orders dashboard page