Skip to content

Commit 1b80dfd

Browse files
committed
colour added
1 parent 5e7614c commit 1b80dfd

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎app.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,17 @@ def overall_records_page(data):
142142

143143
def visualize_data(data):
144144
# Define custom colors for each section
145-
custom_colors = {
146-
"primary_data_count": "green",
147-
"missing_data_count": "red",
148-
"proxy_data_count": "yellow"
149-
}
145+
150146
# Create Pie chart
151147
fig = px.pie(values=[data.primary_data_count.iloc[0], data.missing_data_count.iloc[0],
152148
data.proxy_data_count.iloc[0]],
153149
names=["primary_data_count", "missing_data_count", "proxy_data_count"],
154-
color_discrete_map=custom_colors)
150+
color=["primary_data_count", "missing_data_count", "proxy_data_count"],
151+
color_discrete_map={
152+
"primary_data_count": "green",
153+
"missing_data_count": "crimson",
154+
"proxy_data_count": "orange"
155+
})
155156

156157
st.plotly_chart(fig, use_container_width=True)
157158

0 commit comments

Comments
 (0)