diff --git a/dashboard_CLOUD.py b/dashboard_CLOUD.py index 4bed7f1..b7fd7e9 100644 --- a/dashboard_CLOUD.py +++ b/dashboard_CLOUD.py @@ -17,7 +17,7 @@ import requests from io import StringIO -from plotly.graph_objects import go +import plotly @@ -423,18 +423,23 @@ def main(): else: gauge_color = "red" # Red for declined loans - # Create gauge chart - fig = go.Figure(go.Indicator( - value=gauge_data["score"], - domain={"min": 0, "max": 100}, # Set gauge range 0-100% - title=gauge_title, - mode="number+delta", # Display score and delta (optional) - delta={'reference': gauge_data["threshold"], 'increasing':'', 'decreasing':''}, # Customize delta display (optional) - gauge_shape="circular", # Circular gauge - axis_range=[0, 100], # Set axis range for gauge - color="dark", # Dark background for gauge - bar_color=gauge_color # Set bar color based on score - )) + # Create gauge chart using plotly.Figure and plotly.graph_objects.Indicator + fig = plotly.Figure( + go.Indicator( + value=gauge_data["score"], + domain={"min": 0, "max": 100}, # Set gauge range 0-100% + title=gauge_title, + mode="number+delta", # Display score and delta (optional) + delta={'reference': gauge_data["threshold"], 'increasing':'', 'decreasing':''}, # Customize delta display (optional) + gauge_shape="circular", # Circular gauge + axis_range=[0, 100], # Set axis range for gauge + color="dark", # Dark background for gauge + bar_color=gauge_color # Set bar color based on score + ) + ) + + # Display the gauge chart using Streamlit + st.plotly_chart(fig)