2

I am trying to customize the x Axis labels using react-chartjs-2.

I can use the callback function in the ticks option in the chart options but the value and values that I get as parameters in the callback function is not necessary as they are just values. (I am using horizontal bar chart by using y axis as an index axis)

And those labels depend on the state of the React component that I fetch via react-query. So, I am wondering if it's a good way to include that options variable as a memoized one inside the component.

Any suggestions?

Alan Z
  • 803
  • 1
  • 7
  • 13

0 Answers0