I am trying to search a database for records on specific workout data to use Chart.js to display a line graph showing progress. I have the data returned from axios, but when trying to use chart.js, it give me an error saying I can’t use an array of objects as input for chart, so I need to access the individual properties of each object to create an array for the x and y axis.
What would be the syntax for accessing each date and weightOne from all objects?
one of the 14 objects returned from axios post
I have tried accessing the properties from the axios response in a loop and adding each date and WeightOne to an array, but the arrays are still empty.