0👍
You correctly created the linear gradient
but forgot to assign it to the backgroundColor
property of the dataset
.
datasets: [{
label: 'test',
data: [100, 200, 300],
backgroundColor: gradient // you need to do this
}]
Please take a look at your amended StackBlitz.
- Chartjs-Is it possible to print to pdf a Canvas with other div elements?
- Chartjs-Canvas not rendering after animation without resizing viewport
Source:stackexchange.com