1. Components
  2. bar

Bar

Grouped, stacked and horizontal bars, on categories or on a time axis.

Simple

Monthly revenue
Month Revenue
Jan €12.4k
Feb €13.9k
Mar €11.8k
Apr €16.2k
May €17.8k
Jun €19.4k
@php
    $revenue = [
        ['month' => 'Jan', 'revenue' => 12400],
        ['month' => 'Feb', 'revenue' => 13900],
        ['month' => 'Mar', 'revenue' => 11800],
        ['month' => 'Apr', 'revenue' => 16200],
        ['month' => 'May', 'revenue' => 17800],
        ['month' => 'Jun', 'revenue' => 19400],
    ];
@endphp

<x-ui.echart type="bar" :data="$revenue" index="month" prefix="€" label="Monthly revenue" class="h-72 w-full"
    :config="['revenue' => ['label' => 'Revenue']]" />

Stacked and horizontal

stacked piles the series of each category; horizontal lays the bars down, which suits long category names.

Customers by region and plan
Region Solo Solo Lifetime Team Lifetime
Europe 412 268 96
North America 380 301 122
Africa 214 96 31
Asia 290 174 58
South America 132 71 19
@php
    $regions = [
        ['region' => 'Europe', 'solo' => 412, 'lifetime' => 268, 'team' => 96],
        ['region' => 'North America', 'solo' => 380, 'lifetime' => 301, 'team' => 122],
        ['region' => 'Africa', 'solo' => 214, 'lifetime' => 96, 'team' => 31],
        ['region' => 'Asia', 'solo' => 290, 'lifetime' => 174, 'team' => 58],
        ['region' => 'South America', 'solo' => 132, 'lifetime' => 71, 'team' => 19],
    ];
@endphp

<x-ui.echart type="bar" horizontal stacked :data="$regions" index="region" label="Customers by region and plan" class="h-80 w-full" :config="[
    'solo' => ['label' => 'Solo'],
    'lifetime' => ['label' => 'Solo Lifetime'],
    'team' => ['label' => 'Team Lifetime'],
]" />

On a time axis, with zoom

datetime turns the index into a time axis; zoom adds the slider. Six months of daily bars stay readable.

Daily orders
Date Orders
2026-05-05 60
2026-05-06 63
2026-05-07 67
2026-05-08 70
2026-05-09 73
2026-05-10 111
2026-05-11 78
2026-05-12 81
2026-05-13 82
2026-05-14 84
2026-05-15 85
2026-05-16 85
2026-05-17 120
2026-05-18 85
2026-05-19 84
2026-05-20 83
2026-05-21 81
2026-05-22 79
2026-05-23 77
2026-05-24 110
2026-05-25 72
2026-05-26 69
2026-05-27 67
2026-05-28 64
2026-05-29 61
2026-05-30 58
2026-05-31 91
2026-06-01 54
2026-06-02 52
2026-06-03 50
2026-06-04 49
2026-06-05 48
2026-06-06 48
2026-06-07 83
2026-06-08 48
2026-06-09 49
2026-06-10 51
2026-06-11 53
2026-06-12 55
2026-06-13 57
2026-06-14 95
2026-06-15 63
2026-06-16 66
2026-06-17 70
2026-06-18 73
2026-06-19 77
2026-06-20 80
2026-06-21 118
2026-06-22 86
2026-06-23 89
2026-06-24 92
2026-06-25 94
2026-06-26 96
2026-06-27 97
2026-06-28 133
2026-06-29 98
2026-06-30 99
2026-07-01 98
2026-07-02 97
2026-07-03 96
2026-07-04 95
2026-07-05 128
2026-07-06 90
2026-07-07 88
2026-07-08 85
2026-07-09 83
2026-07-10 80
2026-07-11 77
2026-07-12 109
2026-07-13 71
2026-07-14 69
2026-07-15 67
2026-07-16 65
2026-07-17 63
2026-07-18 62
2026-07-19 96
2026-07-20 61
2026-07-21 61
2026-07-22 62
2026-07-23 63
2026-07-24 64
2026-07-25 66
2026-07-26 103
2026-07-27 71
2026-07-28 73
2026-07-29 76
2026-07-30 80
2026-07-31 83
2026-08-01 87
2026-08-02 125
2026-08-03 93
2026-08-04 97
2026-08-05 100
2026-08-06 102
2026-08-07 105
2026-08-08 107
2026-08-09 144
2026-08-10 110
2026-08-11 111
2026-08-12 112
2026-08-13 112
2026-08-14 111
2026-08-15 111
2026-08-16 144
2026-08-17 108
2026-08-18 106
2026-08-19 104
2026-08-20 101
2026-08-21 98
2026-08-22 96
2026-08-23 128
2026-08-24 90
2026-08-25 87
2026-08-26 85
2026-08-27 82
2026-08-28 80
2026-08-29 78
2026-08-30 112
2026-08-31 75
2026-09-01 75
2026-09-02 74
2026-09-03 74
2026-09-04 75
2026-09-05 76
2026-09-06 112
2026-09-07 79
2026-09-08 81
2026-09-09 84
2026-09-10 87
2026-09-11 90
2026-09-12 93
2026-09-13 131
2026-09-14 100
2026-09-15 103
2026-09-16 107
2026-09-17 110
2026-09-18 113
2026-09-19 116
2026-09-20 153
2026-09-21 120
2026-09-22 122
2026-09-23 123
2026-09-24 124
2026-09-25 125
2026-09-26 125
2026-09-27 160
2026-09-28 124
2026-09-29 123
2026-09-30 121
2026-10-01 119
2026-10-02 117
2026-10-03 114
2026-10-04 147
2026-10-05 109
2026-10-06 106
2026-10-07 103
2026-10-08 100
2026-10-09 98
2026-10-10 95
2026-10-11 128
2026-10-12 91
2026-10-13 90
2026-10-14 89
2026-10-15 88
2026-10-16 87
2026-10-17 88
2026-10-18 123
2026-10-19 89
2026-10-20 90
2026-10-21 92
2026-10-22 95
2026-10-23 97
2026-10-24 100
2026-10-25 138
2026-10-26 106
2026-10-27 110
2026-10-28 113
2026-10-29 116
2026-10-30 120
2026-10-31 123
2026-11-01 161
2026-11-02 129
@php
    // Six months of daily orders on a time axis: zoom in on any week.
    $days = collect(range(0, 181))->map(fn (int $i) => [
        'date' => now()->subDays(182 - $i)->format('Y-m-d'),
        'orders' => (int) round(60 + $i * 0.3 + 22 * sin($i / 7) + ($i % 7 === 5 ? 35 : 0)),
    ])->all();
@endphp

<x-ui.echart type="bar" datetime zoom :data="$days" index="date" label="Daily orders" class="h-80 w-full"
    :config="['orders' => ['label' => 'Orders']]" />

See Chart for installation and every prop.