Summary
I want to put a bar graph under the line chart on same figure.
Code snippet:
import yfinance as yf
import streamlib as st
historical_data = yf.Ticker("AAPL").history(period="5y")
st.header("Stock Data for {}".format(ticker))
st.subheader("Latest Day")
latest_day_data = historical_data.iloc[-1].Close
st.text(f"Price: ${latest_day_data:.2f}")
st.subheader("Historical Data")
st.line_chart(historical_data["Close"])
volume = historical_data.Volume
st.bar_chart(volume)
Expected behavior:
Two graphs must be on same figure like Tradingview as shown below:
Actual behavior:
The plots are on seperate charts as shown in image below:
Debug info
- Streamlit version: 1.16.0
- Python version: 3.10.8
- Using Conda
- OS version: Ubuntu 22.10
Requirements file
conda
yfinance
streamlit