Using React, how should I fetch data from an API so I can display it on Chart.js charts?

I am quite new to this so I hope my question makes sense.
I am trying to build a React app that allows users to input values and then return charts showing data from an API. Here is a simple explanation of how it should work using a weather forecast as an example:
The user chooses the day, hour, and location and submits the form.
These values are inserted into a URL that returns a JSON with the amount of rain expected for that time and place.
The user sees a Chart.js chart showing the amount of rain expected.

I have made some attempts and I have been able to fetch the data using Axios, but I am unable to make it work with the charts, also I feel that my work is not well structured and I would appreciate an overview of how this could best be done.

I fetched the data using axios and tried to assign the values in the data to variables that the charts will display. However, if I do this then the charts won’t show up at all, it seems I’m far from the correct solution.