Chart cards
Shows monthly comparison, ratio and trend charts inside a card.
zb:card + zb:chart zubazar/ui-pro
ApexCharts must be registered: see the Setup section of the Charts page.
This component is in Zubazar UI Pro; Zubazar UI Pro brings Zubazar UI with it. Installing Zubazar UI Pro →
Bar chart
BLADE
zb:chart takes the chart settings from the options array (chart, series, xaxis, colors …).
<zb:card title="Monthly orders" subtitle="Last 6 months">
<zb:chart :height="260" :options="[
'chart' => ['type' => 'bar'],
'series' => [['name' => 'Orders', 'data' => [2810, 2944, 3012, 2890, 3240, 3106]], ['name' => 'Returns', 'data' => [240, 198, 221, 260, 190, 214]]],
'xaxis' => ['categories' => ['Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep']],
'colors' => ['primary', '#e5e7eb'],
'plotOptions' => ['bar' => ['borderRadius' => 4, 'columnWidth' => '45%']],
'dataLabels' => ['enabled' => false],
]" />
</zb:card>
| Prop | Values |
|---|---|
options | ApexCharts settings (array) |
height | Pixels; default 280 |
Ratio gauge
BLADE
For a single ratio, use the radialBar type; series takes a single percentage.
<zb:card title="On-time delivery" subtitle="September 2026">
<zb:chart :height="260" :options="[
'chart' => ['type' => 'radialBar'],
'series' => [94],
'labels' => ['On time'],
'colors' => ['primary'],
'plotOptions' => ['radialBar' => ['hollow' => ['size' => '62%'], 'dataLabels' => ['value' => ['fontSize' => '28px', 'fontWeight' => 600]]]],
]" />
</zb:card>
| Prop | Values |
|---|---|
chart.type | bar | line | area | radialBar | donut … |
Trend chart
BLADE
For change over time, use the area or line type, and stroke.curve for a smooth line.
<zb:card title="Weekly visitors" subtitle="Last 8 weeks">
<zb:chart :height="240" :options="[
'chart' => ['type' => 'area'],
'series' => [['name' => 'Visitors', 'data' => [612, 640, 598, 702, 688, 731, 745, 760]]],
'xaxis' => ['categories' => ['Wk 1', 'Wk 2', 'Wk 3', 'Wk 4', 'Wk 5', 'Wk 6', 'Wk 7', 'Wk 8']],
'colors' => ['primary'],
'stroke' => ['curve' => 'smooth', 'width' => 2],
'dataLabels' => ['enabled' => false],
'fill' => ['type' => 'gradient', 'gradient' => ['opacityFrom' => 0.35, 'opacityTo' => 0.05]],
]" />
</zb:card>
| Prop | Values |
|---|---|
stroke.curve | smooth | straight | stepline |
fill.type | solid | gradient |
In a stat card
BLADE
Put a small chart.sparkline chart in the default slot of zb:stat-card to show the trend of the number.
<div class="grid gap-4 sm:grid-cols-2">
<zb:stat-card label="Orders this month" value="3,106" icon="shopping-bag" color="success" :change="12.5" change-label="vs. last month">
<zb:chart :height="60" :options="[
'chart' => ['type' => 'area', 'sparkline' => ['enabled' => true]],
'series' => [['name' => 'Orders', 'data' => [2810, 2944, 3012, 2890, 3240, 3106]]],
'colors' => ['success'],
'stroke' => ['curve' => 'smooth', 'width' => 2],
]" />
</zb:stat-card>
<zb:stat-card label="Returns" value="214" icon="receipt-refund" color="warning" :change="-4" change-label="vs. last month">
<zb:chart :height="60" :options="[
'chart' => ['type' => 'bar', 'sparkline' => ['enabled' => true]],
'series' => [['name' => 'Returns', 'data' => [240, 198, 221, 260, 190, 214]]],
'colors' => ['warning'],
'plotOptions' => ['bar' => ['borderRadius' => 2, 'columnWidth' => '55%']],
]" />
</zb:stat-card>
</div>
| Prop | Values |
|---|---|
chart.sparkline | ['enabled' => true] |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
options | — | [] | ApexCharts settings; written over the default chart.height, toolbar and fontFamily values |
height | number | 280 | Chart height (px) |
card: title, subtitle | — | null | Card title; the other card props are on the Basic card page |
Developer notes
zb:chartdraws with ApexCharts; the toolbar is off by default, the font is taken from the page and the colors adapt to dark mode automatically.- In the ratio gauge, the size of the text in the middle is set with
plotOptions.radialBar.dataLabels. chart.sparklineremoves the axes and margins; keep the height low.