how to implement rest api to radial bar chart recharts react.js?

541 Views Asked by At

How to implement rest api to radial bar chart in react.js using rechart?

I can't call my api to my radial bar chart using rechart.

https://recharts.org/en-US/api/RadialBar

1

There are 1 best solutions below

0
maha.benjebara On

Create a component where you call your REST API using axios for example

 getData = async (): Promise<string> => {
       let dataJSON = await axios.get('http://webcode.me');
            return dataJSON;
        }
    };

Then you can display your chart as shown in this example https://codesandbox.io/s/simple-radial-bar-chart-qf8fz