Most agile product management software provides pre-baked reports for burndown charts. But if you want more control to visualize the data on a spreadsheet, you could first extract the following data for all user stories in a given sprint.
Estimation technique: story points or effort hours
Sprint start and end dates
Actual story completion date
Total planned and actual recorded sprint effort (per the estimation technique)