How can I change the font (family) for the labels in Chart.JS?
If you wanted to add the font-family to the chart object then you can add it in the options object.
options: {
legend: {
labels: {
fontFamily: 'YourFont'
}
}...}
Here is a link to the docs: https://www.chartjs.org/docs/latest/general/fonts.html
This should be useful: http://www.chartjs.org/docs/. It says "There are 4 special global settings that can change all of the fonts on the chart. These options are in Chart.defaults.global
".
You'll need to change defaultFontFamily
for the font. And defaultFontColor
, defaultFontSize
, and defaultFontStyle
for color, size, etc.