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.
- Name the exercise file, Ex14-Plotly-TimeSeries.py.
- Use yfinance to download financial data from Yahoo.
- 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.
- 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’.
- Place a range slider below the x-axis.
- 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:
