In chart.js how can I set the set the font size for just the x axis labels without touching global config?
I've already tried setting the 'scaleFontSize' option my options object. I've also tried setting:
{
...
scales: {
xAxes: [{
scaleFontSize: 40
...
}]
}
}
Try this is working
Try this simple solution:
Try to see if this will work
It doesn't look like
scaleFontSize
is a valid property.The
fontSize
attribute is actually inscales.xAxes.ticks
and not inscales.xAxes
as you thought.So you just have to edit the attribute like this :
You can see a fully working example in this jsFiddle and here is its result :