| import plotly.graph_objects as go |
| import random |
|
|
| def create_comparison_chart(user_data): |
| categories = ['Team Strength', 'Market Potential', 'Mission Clarity', 'Innovation', 'Scalability'] |
| |
| |
| user_scores = [random.uniform(0.3, 0.9) for _ in range(len(categories))] |
| top_tier_scores = [random.uniform(0.7, 1.0) for _ in range(len(categories))] |
| |
| fig = go.Figure() |
| |
| fig.add_trace(go.Scatterpolar( |
| r=user_scores, |
| theta=categories, |
| fill='toself', |
| name='Your Company' |
| )) |
| |
| fig.add_trace(go.Scatterpolar( |
| r=top_tier_scores, |
| theta=categories, |
| fill='toself', |
| name='Top-Tier Company' |
| )) |
| |
| fig.update_layout( |
| polar=dict( |
| radialaxis=dict( |
| visible=True, |
| range=[0, 1] |
| )), |
| showlegend=True |
| ) |
| |
| return fig |