[Chartjs]-Chart js. How to change font styles for "labels" array?

13👍

It’s well hidden, but you can find this under “Point Label Options”

http://www.chartjs.org/docs/#scales-radial-linear-scale

here is a example:
https://jsfiddle.net/qvrt01jp/1/

options: {
    scale: {
        pointLabels :{
           fontStyle: "bold",
        }
    }
}

global should also work if set it like this:

Chart.defaults.global.defaultFontStyle = 'italic'

-1👍

To give an update for v3.5.1:

Like this for font weights:

Chart.defaults.font.weight = '600';

Or if you want to do it inside the options object:

options: {
    plugins: {
        legend: {
            labels: {
                font: {
                    style: 'italic',
                    weight: '600',
                }
            }
        }
    }
}

Documentation with more info: https://www.chartjs.org/docs/latest/general/fonts.html

Leave a comment