Bootstrap 5 chart cards combine Bootstrap's card component with Chart.js 4 for dashboard data visualization. This page covers 4 chart card patterns — line, bar, doughnut and sparkline.

Setup

<!-- Add Chart.js before closing body -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>

Basic Pattern

<div class="card border-0 shadow-sm">
  <div class="card-body">
    <canvas id="myChart" height="160"></canvas>
  </div>
</div>
<script>
  new Chart(document.getElementById('myChart'), {
    type: 'line',
    data: { labels: [...], datasets: [{ data: [...] }] },
    options: { responsive: true }
  });
</script>

1. Bootstrap 5 Line Chart Card

Revenue line chart inside a Bootstrap card using Chart.js 4.

2. Bootstrap 5 Bar Chart Card

Monthly sales bar chart inside a Bootstrap card — grouped bars for comparison.

3. Bootstrap 5 Doughnut Chart Card

Doughnut chart showing category breakdown alongside a legend list.

4. Bootstrap 5 Sparkline Stat Cards

Compact stat cards with inline mini sparkline charts — common in modern admin dashboards.

Frequently Asked Questions

Add the Chart.js CDN before your closing body tag: <script src='https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js'></script>. Create a canvas element inside your Bootstrap card. Initialize with: new Chart(canvas, { type, data, options }).
Chart.js is responsive by default when responsive:true is set in options. Put the canvas inside a Bootstrap card-body. Set height on the canvas attribute for aspect ratio control: <canvas height='160'>. Don't set a fixed CSS height on the canvas itself.
Pass your colors directly in the dataset: borderColor:'#fd4766', backgroundColor:'rgba(253,71,102,0.08)'. For multiple datasets use an array of colors. Bootstrap's CSS variables are not accessible inside Chart.js — use hex/rgba values directly.
Use Chart.js line chart with all display elements hidden: pointRadius:0, scales.x.display:false, scales.y.display:false, plugins.legend.display:false, plugins.tooltip.enabled:false. Set a small canvas height (40-60px) and fill:true for the area effect.

Need a Full Bootstrap 5 Admin Dashboard?

Get a complete Angular 21 + Bootstrap 5 dashboard with 50+ components — built by the same team behind BootstrapPlanet.

Browse Templates →

Use code FIRST30 for 30% off your first purchase.

Related Components