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

Connected

Exercise

Line graph of sales by country

You are working for a global e-commerce company that has been using third-party software to build in-house graphics for reporting. They are wondering if open-source libraries would provide better graphics for their reporting purposes.

You jump at the opportunity to design a slick (and interactive!) visual with Plotly. Your first task will be to update their basic line figure, which visualizes the total sales by month and country.

In this exercise and subsequent exercises, the code to load the relevant data and packages has been written for you.

Instructions

100 XP
  • Create a line graph object called line_graph using a plotly.express function.
  • Set the DataFrame to ecom_sales and give the graph a title of 'Total Sales by Country and Month'.
  • Use the color argument to create a separate line per country using the 'Country' column.