</> ConvertAtlas Developer Tools
Bootstrap 5 · Intermediate

Chart.js Stacked Bars

A stacked bar chart of channel breakdown, via Chart.js.

Requires Bootstrap 5, Chart.js. Add the CDN tags below to your page (styles in <head>, scripts before </body>). The downloaded file already includes them.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<div class="card border-0 shadow-sm" style="width:420px;max-width:100%"><div class="card-body"><h6 class="fw-bold mb-2">Channel breakdown</h6><canvas id="cjStack" height="180"></canvas></div></div>
new Chart(document.getElementById('cjStack'),{type:'bar',data:{labels:['Q1','Q2','Q3','Q4'],datasets:[{label:'Web',data:[20,25,22,30],backgroundColor:'#0d6efd'},{label:'App',data:[15,18,20,22],backgroundColor:'#ff477e'},{label:'Other',data:[8,6,10,9],backgroundColor:'#f59e0b'}]},options:{plugins:{legend:{position:'bottom'}},scales:{x:{stacked:true},y:{stacked:true}}}});
Free to use.This component uses Bootstrap 5, Chart.js (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.