adrianhajdin / project_corona_tracker

This is a code repository for the corresponding YouTube video. In this tutorial, we are going to build and deploy a corona tracker application. Covered topics: React.js, Chart.js, Material UI, and much more.
https://covid19statswebsite.netlify.com/
1.45k stars 476 forks source link

Problem when displaying the charts #25

Closed RobyCigar closed 3 years ago

RobyCigar commented 3 years ago

image Anyone know why my chart like this? I want to make the latest data on the right side. Thank you.

jayden-leuciuc commented 3 years ago

I have the same question, glad it happened to other people, because this was frustrating.

08fdange commented 3 years ago

It’s because the new API used for global daily data has the dates in descending order. Use the javascript array method “reverse()” on the dailyData before mapping the dates for the labels to solve this.

RobyCigar commented 3 years ago

thank you @08fdange