v0.0.2
Demos (demo panel, opens in a new tab)

Chart cards

Shows monthly comparison, ratio and trend charts inside a card.

zb:card + zb:chart zubazar/ui-pro

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

Bar chart: view
BLADE

zb:chart takes the chart settings from the options array (chart, series, xaxis, colors …).

blade
<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>
PropValues
optionsApexCharts settings (array)
heightPixels; default 280

Ratio gauge

Ratio gauge: view
BLADE

For a single ratio, use the radialBar type; series takes a single percentage.

blade
<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>
PropValues
chart.typebar | line | area | radialBar | donut …

Trend chart

Trend chart: view
BLADE

For change over time, use the area or line type, and stroke.curve for a smooth line.

blade
<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>
PropValues
stroke.curvesmooth | straight | stepline
fill.typesolid | gradient

In a stat card

In a stat card: view
BLADE

Put a small chart.sparkline chart in the default slot of zb:stat-card to show the trend of the number.

blade
<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>
PropValues
chart.sparkline['enabled' => true]

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
options—[]ApexCharts settings; written over the default chart.height, toolbar and fontFamily values
heightnumber280Chart height (px)
card: title, subtitle—nullCard title; the other card props are on the Basic card page

Developer notes

Events, hooks and details
  • zb:chart draws 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.sparkline removes the axes and margins; keep the height low.
Zubazar UI · ZubazarDesigned for people.