Charts

Donut chart

Six slices at most; the rest fold into Other. Hover a slice or a legend row.

How people paid

Today

৳46,690

  • Cash at the gate৳18,45040%
  • bKash৳12,32026%
  • Nagad৳6,11013%
  • Card৳4,3809.4%
  • ParkingOS wallet৳2,9606.3%
  • Other৳2,4705.3%

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { ChartCard, DonutChart } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<DonutChart>

src/components/charts/donut-chart.tsx
PropTypeDefaultDescription
datarequiredDonutDatum[]—
format(v: number) => string(v) => v.toLocaleString()
centerLabelstring"Total"
centerValueReact.ReactNode—Shown in the hole; defaults to the formatted total.
maxSlicesnumber6
otherLabelstring"Other"
heightnumber220
legend"right" | "bottom" | "none""right"
classNamestring—

<ChartCard>

src/components/charts/chart-card.tsx
PropTypeDefaultDescription
titlerequiredstring—
descriptionstring—
seriesSeriesMeta[]—
actionReact.ReactNode—
childrenrequiredReact.ReactNode—
classNamestring—
heightnumber240

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui