X Enterprises
Card

CardDonut

Card displaying a donut chart with a legend table below.

CardDonut

Donut chart card with a legend table showing name and percentage share for each segment. Supports an optional center label and sub-label inside the donut.

Component

<XACardDonut />

Renders a donut chart with configurable segments and a legend table below. The center of the donut can display a primary label and secondary sub-label.

<XACardDonut
  title="Revenue by Region"
  total-value="$248,000"
  :data="[
    { name: 'North America', value: 45, color: '#3b82f6' },
    { name: 'Europe', value: 30, color: '#10b981' },
    { name: 'Asia Pacific', value: 25, color: '#f59e0b' },
  ]"
  center-label="Total"
  center-sub-label="$248K"
/>

Props

PropTypeDefaultDescription
titlestringRequired. Card title.
totalValuestringRequired. Formatted total displayed under the title.
data{ name: string; value: number; color: string }[]Required. Donut segments.
centerLabelstringundefinedText on the first line of the donut center.
centerSubLabelstringundefinedText on the second line of the donut center.
legendNameLabelstring'Category'Header for the name column in the legend table.
legendValueLabelstring'Share'Header for the value column in the legend table.

AI Context

component: XACardDonut
package: "@xenterprises/nuxt-x-app"
use-when: Segment breakdown visualization where you want a donut chart with a legend table showing name and percentage share per segment.
patterns:
  - data segments use { name, value, color } shape.
Copyright © 2026