How can I change the font (family) for the labels in Chart.JS?

后端 未结 4 484
走了就别回头了
走了就别回头了 2020-12-03 17:06

I want to change the font to something snazzier in my Chart.JS horizontal bar chart. I\'ve tried the following, but none of it works:

var optionsBar = {
             


        
4条回答
  •  余生分开走
    2020-12-03 18:03

    Change font size,color,family and weight using chart.js

    scales: {
            yAxes: [{ticks: {fontSize: 12, fontFamily: "'Roboto', sans-serif", fontColor: '#000', fontStyle: '500'}}],
            xAxes: [{ticks: {fontSize: 12, fontFamily: "'Roboto', sans-serif", fontColor: '#000', fontStyle: '500'}}]
            }
    

    See Full code

    
        Chart.js
        
        
        
        
    
    
        

提交回复
热议问题