Skip to content

Commit

Permalink
Update dashboard_CLOUD.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Isdinval authored Jun 6, 2024
1 parent f2a7e6d commit 5a68020
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions dashboard_CLOUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import requests
from io import StringIO
from plotly.graph_objects import go
import plotly



Expand Down Expand Up @@ -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)



Expand Down

0 comments on commit 5a68020

Please sign in to comment.