I have to create a dash app which takes ingests a csv file of employee data and groups them by dept (engineering, marketing, etc…) and seniority (jr, mid, sr) and produce a bar graph that shows a count of employees for each seniority group for a given dept. The bar graph shows the counts for one department at a time so I filter the master data frame by dept before passing to the plotly graph. Changing the dept is controlled by a dropdown.
The issue is that sometimes a particular dept may not have any JR employees so the plotly graph will only show a bar and x-axis value for MID and SR. I need to be able to show JR, MID, and SR as as value on the x-axis at all times and have the y-axis default to zero.
Is there anyway to do this ? I’ve been searching for hours and cannot find an answer.