Donut Chart
Preview
$115,150
Monthly revenue
Select a plan to filter
Install
Add it with your package manager, or copy the source manually.
Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide
Download the release archive to your project root, then install the local file.
Import the shared styles once in your application.
API Reference
DonutChart
segmentsreadonly DonutSegment[]—thickness?numberRing thickness in viewBox units; the chart is 200 wide.
—gap?numberDegrees of empty space between neighbouring segments.
—v-model:activeId?string | nullFocused segment, shared by the ring, center, and legend.
—defaultActiveId?string | null—@active-change?(id: string | null) => void—@select?(id: string) => voidCalled when a legend item is clicked.
—selectedId?string | nullMarks a legend item as pressed.
—formatValue?(value: number) => string—label?stringAccessible name for the chart.
—labels?Partial<DonutChartMessages>Override any built-in string.
—class?string—#default?slotCompose `DonutChartPlot` and `DonutChartLegend`; omit it for the complete chart. ```vue <DonutChart :segments="segments" :format-value="usd"> <DonutChartPlot><DonutChartCenter total-label="Monthly revenue" /></DonutChartPlot> <DonutChartLegend /> </DonutChart> ```
—DonutChartCenter
#default?{ segment: DonutPlacedSegment | null; total: number }Custom content for the hole. Receives the focused segment, or null when nothing is focused, and the total.
—totalLabel?stringCaption under the total when nothing is focused.
—class?string—#totalLabel?slotCaption under the total when nothing is focused.
—DonutChartLegend
#renderDetail?{ segment: DonutPlacedSegment }Extra line under each name, such as terms or a note.
—#renderValue?{ segment: DonutPlacedSegment }Trailing value. Defaults to the share and formatted value.
—class?string—DonutChartPlot
#default?slotCentered overlay, usually `DonutChartCenter`.
—class?string—Updated