Hello everybody!
Hope you all are staying safe.
I am doing a COVID tracker with my friend and we are trying to create a line graph that displays the historical data of the confirmed cases on the right as shown below.
The web page
We are planning to place the onClick function on the 1. Bar Graph and based on which province is selected the 2. Line Graph will get populated with that data.
How can we know which particular province is getting clicked though? And how do we access that particular province’s name?
I can see the name in the props children object, but I don’t know how to access it:
Since the code is too long I will link our GitHub page:
https://github.com/covid-tracker/covid-tracker/tree/master/src
Lol, we know the code is a mess right now.
We used Recharts (1. Bar Graph) & VictoryChart (2. Line graph) for this project.
Victory Chart: https://formidable.com/open-source/victory/docs/victory-line
Rechart: https://recharts.org/en-US/api/BarChart
Thank you so much!