0

Having trouble with adding font color to black in the react chart js library

chatjs data

Drew Reese
  • 165,259
  • 14
  • 153
  • 181

1 Answers1

1

Assuming you want to change the font color of the tick labels, this can be done through the axes ticks configuration as follows.

const options = {
  scales: {
    x: {
      ticks: {
        color: 'black'
      }
    },
    y: {
      ticks: {
        color: 'black'
      }
    }
  }
};

...

<Bar options={options} data={data} />;

For further details, please consult Tick Configuration from the Chart.js documentation

uminder
  • 23,831
  • 5
  • 37
  • 72