[Chartjs]-How to add font color in vue-chartjs

3👍

You should do this in options… Second argument of this.renderChart.

just put the fontColor option:

...
mounted () {
   // Overwriting base render method with actual data.
   this.renderChart({
      labels: [...],
      datasets: [
          ...
      ],
   }, 
   {
       responsive: true, 
       maintainAspectRatio: false,
       legend: {
          ...,
          fontColor: 'white'
       },
       ...
       scales: {
          yAxes: [{
            ticks: {
                ...
                fontColor: 'white'
            }
          }],
          xAxes: [{
            ticks: {
                ...
                fontColor: 'white',
            }
          }]
       }
   })
}

Leave a comment