@Marisa_Smith ,
I am having a very similar problem. Can you please elaborate on how to adjust the column ? Here is an example of what I am seeing:
Here is the code to regenerate what I am seeing:
# Import required libraries
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
# User Defined Functions
def plotly_bar_chart(
df: pd.DataFrame,
x_axis_label: str = 'Month',
y_axis_label: str = 'Monthly Value (in %)'
) -> go.Figure:
this_chart = go.Figure(
data=[go.Bar(x=df['Month'], y=df['Monthly_Value'], text = df['Monthly_Value'],textposition = 'auto')])
this_chart.update_yaxes(title_text=y_axis_label)
this_chart.update_xaxes(title_text=x_axis_label)
return this_chart
# Start setup of the app
# Title
st.subheader("Streamlit Testing")
# Add user input widgets to the side bar
param_1 = st.sidebar.number_input(label='Random Value - 1', min_value=-90., max_value=90.)
param_2 = st.sidebar.number_input(label='Random Value - 2', min_value=-180., max_value=180.)
net = st.sidebar.number_input('Tolerance (in deg)')
start = st.sidebar.text_input('Start Date (yyyy-mm-dd)')
stop = st.sidebar.text_input('Stop Date (yyyy-mm-dd)')
completeness = st.sidebar.number_input('Completeness Filter', min_value=0., max_value=1.)
# Prepare data for plot
monthly_values = [1.2, 1.4, 2.0, 3.5, 4.7, 0.7, 1.3, 1.5, 1.5, 2.0, 2.5, 3.2]
month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October',
'November', 'December']
data_dict = {'Month': month_names, 'Monthly_Value': monthly_values}
data = pd.DataFrame(data_dict)
# Prepare plot
figure, table = st.beta_columns((3, 2))
with table:
st.write(data)
with figure:
st.write('Monthly Rate')
chart = plotly_bar_chart(df=data)
st.plotly_chart(chart)