@Deepanshu-5288Submitted about 2 years ago
Hi All, Any suggestions on how I can import the JSON data file into my javascript file as right now I have pasted JSON data in my .js file and then created a dynamic bar chart. Thanks
Hi All, Any suggestions on how I can import the JSON data file into my javascript file as right now I have pasted JSON data in my .js file and then created a dynamic bar chart. Thanks
Same as neoma Peace, you can use the fetch API to get your JSON data.
If you decide to fetch your data and you struggle to solve this problem you can check how to use promises in javascript. Neoma use the async await method but there are 2 other methods to fetch your data.
Otherwise your solution looks very great, congratulations !