File size: 1,512 Bytes
c50cea5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import plotly.express as px
import pandas as pd

def generate_chart(analysis_option, data):
    if analysis_option == "Employee Satisfaction":
        return px.bar(data, x="DepartmentType", y="Satisfaction Score", 
                      title="Satisfaction Score by Department", color="DepartmentType")

    elif analysis_option == "Department Performance":
        return px.line(data, x="DepartmentType", y=["Performance Score", "Current Employee Rating"], 
                       title="Departmental Performance Trends", markers=True)

    elif analysis_option == "Training Analytics":
        return px.bar(data, x="Training Program Name", y="Training Outcome", 
                      title="Training Participation by Program", color="Training Program Name")

    elif analysis_option == "Cost-Benefit Analysis":
        return px.scatter(data, x="DepartmentType", y="ROI", title="ROI by Department", size="ROI")

    elif analysis_option == "Training Effectiveness":
        return px.bar(data, x="Training Program Name", y="Performance Score", 
                      title="Training Effectiveness by Program", color="Training Program Name")

    elif analysis_option == "Diversity & Inclusion":
        return px.bar(data, x="Category", y="Count", color="Group",
                      title="Diversity & Inclusion Breakdown", barmode="stack")

    elif analysis_option == "Career Development":
        return px.histogram(data, x="Career Movements", title="Career Progression Histogram")

    return None