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

Connected

Exercise

Click to update another plot

The hover-to-update plot was very well received. What magic! Your work is making experiences out of tired, static visuals.

There has been a request to change the dashboard you created in the last lesson. The reporting hierarchy of the e-commerce company begins at country, then major category, then minor category. Therefore, they would prefer if the hover didn't update the bottom bar chart.

Instead, they wonder if you could click on the major category bar chart and have that update the bar chart below. This has been requested because there is a desire to understand how the proportion of sales by major category differs between countries.

From your recent work on clicks and hovers, you know just the way to implement it!

Instructions

100 XP
  • Ensure the 'Major Category' will be available in the click data by adding it to the custom_data parameter of the major category bar chart below line 37.
  • Set up a callback below line 45 that updates the minor_cat chart when a bar in the major_cat chart is clicked.