Ex14 - Plotly-TimeSeries:

Objective: Write a bit of Python code to create a time series chart that displays the stock prices of IBM, Google and Airbnb for an 18-month period from 2-Dec-2024 to 1-Jun-2026.

Description: Create a time series chart using Plotly Graph Objects.


  1. Name the exercise file, Ex14-Plotly-TimeSeries.py.
  2. Use yfinance to download financial data from Yahoo.
  3. Three yf.download() functions should be used to capture the stock prices of IBM (IBM), Google (GOOG), and Airbnb (ABNB) for an 18-month period from 2024-12-02 to 2026-06-01.
  4. Then, instantiate the traces on the time series chart by using three go.Scatter() classes.
    • a. Markers should be added to each trace by setting the mode argument to ‘lines+markers’.
  5. Place a range slider below the x-axis.
  6. Finally, create a range selector with the following two buttons:
    • a. The first should show the data for a period of nine months.
    • b. The second should reset the chart and zoom out to display all available data.
  • Submit the python (.py) file to Canvas. The web browser should render an output similar to the below:

A time series chart displaying stock prices for IBM, Google, and Airbnb across an 18-month period from 2024-12-02 to 2026-06-01