# Line
{ type: 'line', data: { labels: labels, datasets: [{ backgroundColor: Utils.color(0), borderColor: Utils.color(0), data: Utils.numbers({ count: DATA_COUNT, min: 0, max: 100 }), datalabels: { align: 'start', anchor: 'start' } }, { backgroundColor: Utils.color(1), borderColor: Utils.color(1), data: Utils.numbers({ count: DATA_COUNT, min: 0, max: 100 }) }, { backgroundColor: Utils.color(2), borderColor: Utils.color(2), data: Utils.numbers({ count: DATA_COUNT, min: 0, max: 100 }), datalabels: { align: 'end', anchor: 'end' } }] }, options: { plugins: { datalabels: { backgroundColor: function(context) { return context.dataset.backgroundColor; }, borderRadius: 4, color: 'white', font: { weight: 'bold' }, formatter: Math.round, padding: 6 } }, // Core options aspectRatio: 5 / 3, layout: { padding: { top: 32, right: 16, bottom: 16, left: 8 } }, elements: { line: { fill: false, tension: 0.4 } }, scales: { y: { stacked: true } } } }
Bar →