File size: 866 Bytes
5657e82
 
 
 
 
 
 
 
cd0fc76
5657e82
 
 
 
 
cd0fc76
5657e82
 
 
 
 
cd0fc76
5657e82
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import pandas as pd
import plotly.graph_objs as go

def create_sector_plot(df, sector_name):
    fig = go.Figure()

    fig.add_trace(go.Scatter(
        x=df.index, y=df['Privilege_Avg_Score'],
        mode='lines+markers', name='Privilege',
        text=df['Role'], hoverinfo='text+y'
    ))

    fig.add_trace(go.Scatter(
        x=df.index, y=df['Protect_Avg_Score'],
        mode='lines+markers', name='Protection',
        text=df['Role'], hoverinfo='text+y'
    ))

    fig.add_trace(go.Scatter(
        x=df.index, y=df['Neutral_Avg_Score'],
        mode='lines+markers', name='Neutral',
        text=df['Role'], hoverinfo='text+y'
    ))

    fig.update_layout(
        title=f'{sector_name} Sector Scores',
        xaxis_title='Resume Index',
        yaxis_title='Score',
        legend_title='Score Type',
        hovermode='closest'
    )

    return fig