1
votes

Using ng2-charts and have a great pie-chart working and looking great, able to set labels & data as working but cannot change the label color from the grey?

Is that expected or how to over-write the default label color?

Seems like it's setting the default font-color from charts.js (#666), wondering if we can overwrite that in ng2-charts?

Edit was using the chartjs-plugin-datalabels plugin and found answer in the docs.

1
Note: This is the labels on the pieChart itself. Not the legend. - Andyrewwer

1 Answers

2
votes

Are you looking for this ?Demo

 legend: {
  display: true,
  labels: {
    fontColor: 'red'
  }
},tooltips :{
  backgroundColor:'white',
  callbacks:{
    labelTextColor: function(tooltipItem, chart) { 
       return "black";     
    },

  }
}