Does anyone know how to apply different styles to the elements present inside the array which is in labels array in chart.js.See it below to take a look at what I meant.
I made chart where see the labels are shown on two lines 1.Temperature 2.Time
But I want labels to look like this:
How should I style the labels?
const data = {
labels: [
['21°', '10am'],
['21°', '10am'],
['21°', '10am'],
['21°', '10am'],
['21°', '10am'],
['21°', '10am'],
],
datasets: [{
data: [21, 20, 3, 3, 3, 21],
}, ],
};
const options = {
xAxes: [{
gridLines: {
drawBorder: false,
lineWidth: 1.8,
zeroLineWidth: 1.8,
zeroLineColor: 'rgba(0,0,0,.3)',
color: 'rgba(0,0,0,.3)',
},
ticks: {
fontColor: 'black',
fontSize: 15,
padding: 7,
},
scaleLabel: {
fontColor: 'rgb(0,0,0)',
},
}, ],
}