1. Learn
  2. /
  3. Courses
  4. /
  5. Building Dashboards with Dash and Plotly

Exercise

Enhancing the sales dashboard

The e-commerce company you have been working with has been loving the work you have produced so far. Before working with you, they didn't know what was possible, and now they have some complex and creative requests for you!

They have requested an epic dashboard with a laundry list of functionality. Luckily, most of this can be drawn from your previous work with them. There is just a bit of plumbing to do to tidy it up and pull it all together.

Now they wish to have:

  • A line chart of the total sales by month
    • That can be filtered by a major and minor category dropdown
    • Selecting a major category should subset the minor category options to only relevant ones
  • A table of key stats for major and minor categories below this
  • A bar chart of sales by country
    • Hovering this should filter the bar chart by minor category
  • A bar chart of sales by minor category

Instructions

100 XP
  • Set up the columns and data for the DataTable creation below line 29.
  • Set up the Data Table to use Dash's built-in sorting, filtering, and pagination, starting at the first page, with 7 items per page below line 33.
  • Insert the Data Table into the app.layout below line 71.
  • Ensure the callback for the top of the dashboard can send two outputs below line 83.