I've been looking for a way to draw this graph using Chartjs but haven't been successful. Would this be possible in Chartjs?
Here's my setup:
const stacked_bar_data = {
labels: ['Axi-cel', 'Tisa-cel'],
datasets: [
{
label: 'Bridging therapy 2',
data: [25, 25],
backgroundColor: ['rgb(224, 178, 40)', 'rgb(78, 235, 255)']
},
{
label: 'Bridging therapy 1',
data: [25, 25],
backgroundColor: ['rgb(204, 158, 20)', 'rgb(58, 215, 240)']
}
]
}
const stacked_bar_config = {
type: 'bar',
data: stacked_bar_data,
options: {
responsive: true,
scales: {
x: {
stacked: true,
grid: {
display: false
}
},
y: {
stacked: true,
grid: {
display: false
},
title: {
display: true,
text: 'Use, %'
}
}
}
}
}
var stacked_bar = new Chart(document.getElementById('stacked-bar').getContext('2d'), stacked_bar_config)
I know how to set up for the stacked bar chart, just don't know how to set up for the legend to be like in the image. Any help is appreciated. Thanks in advance!