Reputation: 1160
I am unable to change the font of my labels. As you can see below I have a label that says "# of votes"
and another label that says "# of points"
. I want to make the size bigger for them. So i even added the following:
label: {
fontSize: 50
},
But I have had no luck
MY JS CODE
var options = {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [
{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 1,
backgroundColor: 'rgba(255, 0, 15, 0.54)'
},
{
label: '# of Points',
data: [7, 11, 5, 8, 3, 7],
borderWidth: 1
}
]
},
options: {
label: {
fontSize: 50
},
scales: {
yAxes: [{
ticks: {
reverse: false
}
}]
}
}
}
var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
Upvotes: 1
Views: 233
Reputation: 147
Try something like this (in my project works fine) :
options: {
legend: {
labels: {
fontSize: 50
}
},
//rest of options
Upvotes: 2