2👍
You can change each individual line on the Y-axis by adding a color array to gridLines.
options={{
scales: {
yAxes: [{
gridLines: {
color: ['rgba(36, 206, 0, 0.8)', 'rgba(255, 255, 0, .8)','rgba(255, 162, 0, 0.8)','rgba(36, 206, 0, 0.8)'],
}
}],
},
}}
1👍
You can set individual colors for the horizontal and vertical gridlines by adding a scales
configuration to your options
:
scales: {
yAxes: [{
gridLines: {
color: 'green'
}
}],
xAxes: [{
gridLines: {
color: 'red'
}
}]
}
- [Chartjs]-How to show gradient vertically on chart js grouped bar chart?
- [Chartjs]-Cannot read property 'labels' of undefined
Source:stackexchange.com