Black Lives Matter. Please consider donating to Black Girls Code today.

2nd dropdown menu for Y Axis

I have a simple horizontal bar chart with 4 projects, the first drop-down menu can filter for each project. I am trying to create a second drop-down menu that would filter the Y-Axis for a given month. Ideally I would be able to select n number of months( eg Jan or Jan & Feb) im not sure how to go about this. The final output as an Example( Project 1, Jan & March). Any suggestions would be appreciated.

import plotly.plotly as py
from plotly.graph_objs import *

months = [‘January’, ‘February’, ‘March’, ‘April’, ‘May’, ‘June’]
Project1 = [495, 1139, 1635,2800]
Project2 = [2100, 4250, 2436]
Project3 = [12210, 3450, 4350]
Project4 = [2750, 5900, 11400,12500]

trace1 = Bar(
x=Project1, y=months,
name=‘Project1’,
orientation = ‘h’,
marker = dict(
color = ‘rgba(246, 78, 139, 0.6)’,
line = dict(
color = ‘rgba(246, 78, 139, 1.0)’,
width = 3)
)

)

trace2 = Bar(
x=Project2, y=months,
name=‘Project2’,
orientation = ‘h’,
marker = dict(
color = ‘rgba(58, 71, 80, 0.6)’,
line = dict(
color = ‘rgba(58, 71, 80, 1.0)’,
width = 3)
)
)

trace3 = Bar(
x=Project3, y=months,
name=‘Project3’,
orientation = ‘h’,
marker = dict(
color = ‘rgba(58, 71, 80, 0.6)’,
line = dict(
color = ‘rgba(58, 71, 80, 1.0)’,
width = 3)
)
)

trace4 = Bar(
x=Project4, y=months,
name=‘Project4’,
orientation = ‘h’,
marker = dict(
color = ‘rgba(58, 71, 80, 0.6)’,
line = dict(
color = ‘rgba(58, 71, 80, 1.0)’,
width = 3)
)
)

data = Data([trace1, trace2, trace3, trace4])
layout = Layout(
title=‘EPC Projects’,
updatemenus=list([
dict(
x=-0.05,
y=1,
yanchor=‘top’,
buttons=list([
dict(
args=[‘visible’, [True, True, True, True]],
label=‘All Projects’,
method=‘restyle’
),
dict(
args=[‘visible’, [True, False, False, False]],
label=‘Project1’,
method=‘restyle’
),
dict(
args=[‘visible’, [False, True, False, False]],
label=‘Project2’,
method=‘restyle’
),
dict(
args=[‘visible’, [False, False, True, False]],
label=‘Project3’,
method=‘restyle’
),
dict(
args=[‘visible’, [False, False, False, True]],
label=‘Project4’,
method=‘restyle’
)
]),
)
]),
)

fig = Figure(data=data, layout=layout)
py.iplot(fig)

To increase the chances of someone helping you with this, can you please include a screenshot and link to your plot?