141π
The fontSize
attribute is actually in scales.xAxes.ticks
and not in scales.xAxes
as you thought.
So you just have to edit the attribute like this :
var options = {
scales: {
yAxes: [{
ticks: {
fontSize: 40
}
}]
}
}
You can see a fully working example in this jsFiddle and here is its result :
66π
Configuration options and properties for chartjs 3.0 has changed. Currently Iβm using Chartjs 3.1.1. Fonts are used as objects now. In order to change font size of x axis ticks you have to use following configuration.
var options = {
scales: {
x: {
ticks: {
font: {
size: 12,
}
}
}
}
};
Checkout this jsfiddle sample.
9π
options: {
locale: 'fa-IR',
responsive: true, // Instruct chart js to respond nicely.
maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
plugins: {
legend: {
position: 'top',
labels: {
font: {
size: 9,
family:'vazir'
}
}
},
title: {
display: true,
text: chart_info.chartTitle,
font: {
size: 16,
family:'vazir'
}
},
tooltip: {
bodyFont: {
size: 13,
family:'vazir'
}
}
},
scales: {
x: {
ticks: {
font: {
size: 10,
family:'vazir'
}
}
},
y: {
ticks: {
font: {
size: 10,
family:'vazir'
}
}
}
}
}
8π
Try this is working
options: {
scales: {
xAxes: [{
ticks: {
fontSize: 10
}
}]
}
}
4π
Try to see if this will work
{
...
scales: {
xAxes: [{
fontSize: 40
...
}]
}
}
It doesnβt look like scaleFontSize
is a valid property.
1π
Try this
Chart.defaults.global.defaultFontSize = 8;
0π
Try this simple solution:
myChart.options.scales.yAxes[0].ticks.fontSize = 40 ;
myChart.update();
0π
Currently, Iβm using ^2.9.4 chart.js. Iβve tried other solutions posted here and did some tweak.
options: {
scales: {
yAxes: [{
ticks: {
minor: {
fontSize: 16
}
}
}],
xAxes: [{
ticks: {
minor: {
fontSize: 16
}
}
}]
}
}