Build a widget that fetches birth year data from an API and display the data in a histogram, bucketing by the data by decades.

Requirements

The example below shows a potential resulting histogram but you are free to style it.

Birth year histogram example

Notes

Source

This question is adapted from FrontendEval's Data fetching and visualization question.

Solution

Solution

With most data fetching and display problems, the solution can be broken down into:

  1. Fetching data.
  2. Processing the data, if necessary.
  3. Displaying the data.