GMARTINEZMILLA commited on
Commit
1ea7063
1 Parent(s): accd0d7

feat: generated files

Browse files
Files changed (1) hide show
  1. app.py +7 -18
app.py CHANGED
@@ -83,8 +83,8 @@ elif page == "Customer Analysis":
83
 
84
  # Add the data trace (pink line)
85
  fig.add_trace(go.Scatterpolar(
86
- r=values + values[:1], # Repeat first value to close the polygon
87
- theta=manufacturers + manufacturers[:1],
88
  fill='toself',
89
  fillcolor='rgba(255, 105, 180, 0.2)', # Light pink fill
90
  line=dict(color='rgb(255, 105, 180)', width=2), # Pink line
@@ -94,8 +94,8 @@ elif page == "Customer Analysis":
94
 
95
  # Add the outer boundary (blue line)
96
  fig.add_trace(go.Scatterpolar(
97
- r=[1]*len(manufacturers) + [1], # A list of 1's to create the outer boundary
98
- theta=manufacturers + manufacturers[:1],
99
  mode='lines',
100
  line=dict(color='rgb(100, 149, 237)', width=2), # Cornflower blue
101
  showlegend=False
@@ -106,31 +106,20 @@ elif page == "Customer Analysis":
106
  polar=dict(
107
  radialaxis=dict(
108
  visible=True,
109
- range=[0, 1],
110
  showline=False,
111
- showticklabels=False,
112
  ),
113
  angularaxis=dict(
114
  showline=True,
115
  linecolor='rgb(192, 192, 192)', # Light gray
116
  tickcolor='rgb(192, 192, 192)',
117
  ),
118
- gridshape='circular',
119
  ),
120
  showlegend=False,
121
- paper_bgcolor='white',
122
- plot_bgcolor='white',
123
  )
124
 
125
- # Add radial grid lines
126
- for i in range(1, 5): # 4 concentric circles
127
- fig.add_shape(
128
- type="circle",
129
- xref="x", yref="y",
130
- x0=-i/4, y0=-i/4, x1=i/4, y1=i/4,
131
- line=dict(color="rgb(192, 192, 192)", width=1),
132
- )
133
-
134
  # Show the plot in Streamlit
135
  st.plotly_chart(fig)
136
 
 
83
 
84
  # Add the data trace (pink line)
85
  fig.add_trace(go.Scatterpolar(
86
+ r=values,
87
+ theta=manufacturers,
88
  fill='toself',
89
  fillcolor='rgba(255, 105, 180, 0.2)', # Light pink fill
90
  line=dict(color='rgb(255, 105, 180)', width=2), # Pink line
 
94
 
95
  # Add the outer boundary (blue line)
96
  fig.add_trace(go.Scatterpolar(
97
+ r=[max(values) * 1.1] * len(manufacturers), # Slightly larger than the maximum value
98
+ theta=manufacturers,
99
  mode='lines',
100
  line=dict(color='rgb(100, 149, 237)', width=2), # Cornflower blue
101
  showlegend=False
 
106
  polar=dict(
107
  radialaxis=dict(
108
  visible=True,
109
+ range=[0, max(values) * 1.1],
110
  showline=False,
111
+ showticklabels=True,
112
  ),
113
  angularaxis=dict(
114
  showline=True,
115
  linecolor='rgb(192, 192, 192)', # Light gray
116
  tickcolor='rgb(192, 192, 192)',
117
  ),
 
118
  ),
119
  showlegend=False,
120
+ title=f'Radar Chart for Top 6 Manufacturers of Customer {customer_code}',
 
121
  )
122
 
 
 
 
 
 
 
 
 
 
123
  # Show the plot in Streamlit
124
  st.plotly_chart(fig)
125