X Enterprises
Card

CardChartExpenses

Expenses card with a stacked or grouped bar chart.

CardChartExpenses

Expenses card with a stacked or grouped bar chart and full axis control. Combines a summary header value with a purpose-built bar chart for category-based expense visualization.

Component

<XACardChartExpenses />

Renders a title, summary value, and a bar chart driven by a data array and category map. Supports stacked and grouped modes, axis configuration, and legend placement.

<XACardChartExpenses
  title="Expenses by Product"
  value="$32,400"
  :data="expensesData"
  :categories="{
    sales: { name: 'Sales', color: '#3b82f6' },
    counter: { name: 'Counter', color: '#f59e0b' },
  }"
  stacked
/>

Props

PropTypeDefaultDescription
titlestring''Card title.
valuestring''Summary value.
dataExpensesDataItem[]Required. Bar data ({ product, sales, counter }).
categoriesExpensesCategoriesRequired. Category map.
heightnumber140Chart height in px.
stackedbooleantrueStack bars.
hideXAxisbooleantrueHide X-axis labels.
yNumTicksnumber4Y-axis ticks.
yAxisstring[]['sales', 'counter']Data keys.
legendPosition'top' | 'bottom' | 'left' | 'right''top'Legend placement.
hideLegendbooleanfalseHide the legend.
radiusnumber8Bar corner radius.
barPaddingnumber0.6Bar padding.

AI Context

component: XACardChartExpenses
package: "@xenterprises/nuxt-x-app"
use-when: Expense analytics card showing category breakdown via a stacked or grouped bar chart.
patterns:
  - Supports both stacked and grouped bar modes via the stacked prop.
Copyright © 2026