How to add font family to Chart.js V3.7.0

I tried both this:

plugin: { label: { font: { family: "Lato" } }
}

and this:

myChart.defaults.global.defaultFontFamily = "Lato";

Pieces of code to add Lato font family to my chart, but both cases didn't work.

Any better suggestions? Note that the version I use is 3.7.0. Thanks in advance!

2 Answers

For global use: Chart.defaults.font.family = "Lato".
Details here.

5

The correct way to specify would be like this (in options):

plugins: { // not plugin legend: { // extra layer: legend labels: { // with an "s" font: { family: "Lato" // right here } } }
}
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like