Hi there,
what I have is this:
What I want is something like this:
Is this possible?
This is the code I have:
{
type: 'bar',
data: {
labels: [
'0',
'2',
'5',
'5',
'10',
'15',
'20',
'25'
],
datasets: [
{
label: 'Haushaltsstrom',
backgroundColor: '#ddd',
data: [
300,
-93,
-25,
-67,
51,
-97,
9
],
},
{
label: 'E-Auto',
backgroundColor: '#df4539',
data: [
400,
13,
-38,
89,
-10,
75,
-52
],
},
],
},
options: {
title: {
display: false,
},
scales: {
xAxes: [
{
stacked: true,
scaleLabel: {
display: true,
labelString: "Zeit in Jahren",
}
},
],
yAxes: [
{
stacked: false,
scaleLabel: {
display: true,
labelString: "€",
}
}
]
},
},
plugins: {
datalabels: {
display: true,
align: 'top',
backgroundColor: '#000',
borderRadius: 10
},
}
}
The data labels are not being displayed at all
Thanks for your help!
Best,
Julian